CodeIgniter PHP Apache 500 Internal Server Error -
CodeIgniter PHP Apache 500 Internal Server Error -
i have done project in codeigniter working fine on localhost giving 500 internal server error in remote server .htacces file content.
rewriteengine on rewritebase /ezgov rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l]
please help me
open httpd.conf located in apache installation directory in windows
/apache/conf/httpd.conf
and
/etc/httpd/httpd.conf
in unix based systems. httpd.conf apache configuration file stores various info server.
search module mod_rewrite.so
or (mod_rewrite.c
in rare cases). mod_rewrite module developed rewrite requested urls on fly. of time find in commented state.
#loadmodule rewrite_module modules/mod_rewrite.*
here #
character represents commented or disabled.
loadmodule rewrite_module modules/mod_rewrite.*
remove #
, restart apache http server using command apache -k restart
in windows or service httpd restart
in unix systems. utilize xampp/wamp ui restart apache in windows systems.
next create .htaccess
file in root directory codeigniter project located , paste next code
# index file can index.php, home.php, default.php etc. directoryindex index.php # rewrite engine rewriteengine on # status escaping special chars rewritecond $1 !^(index\.php|robots\.txt|favicon\.ico) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ ./index.php/$1 [l,qsa]
next find codeigniter configuration file, located in it's configuration directory.
./application/config/config.php
open file , create $config['index_page']
value empty. looks this
/* |-------------------------------------------------------------------------- | index file |-------------------------------------------------------------------------- | | typically index.php file, unless you've renamed | else. if using mod_rewrite remove page set | variable blank. | */ $config['index_page'] = '';
now story ended. should work fine. can find more info httpd.config @ apache module mod_rewrite. hope helps you. thanks!!
php apache .htaccess codeigniter mod-rewrite
Comments
Post a Comment