php - Codeigniter 3 : 404 page error, .htaccess not working -
it may old , regular query codeigniter + 404 page error. have tried answered previous stackoverflow questions this. but, couldn't solve problem.
have copied codeigniter project system (ubuntu os 64 bit) ubuntus os system. but, getting 404 page default.if give http://localhost/project/index.php/admin/login
working not http://localhost/project/admin/login
or http://localhost/project
.
here configuration: config.php
$config['base_url'] = 'http://localhost/html/project'; $config['modules_locations'] = array( apppath.'modules/' => '../modules/', ); $config['index_page'] = ''; $config['uri_protocol'] = 'auto';
and .htaccess file:
options followsymlinks <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?/$1 [l] </ifmodule> <ifmodule !mod_rewrite.c> errordocument 404 /index.php </ifmodule>
try rewriting this:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / #removes access system folder users. #additionally allow create system.php controller, #previously not have been possible. #'system' can replaced if have renamed system folder. rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php?/$1 [l] #when application folder isn't in system folder #this snippet prevents user access application folder #rename 'application' applications folder name. rewritecond %{request_uri} ^application.* rewriterule ^(.*)$ /index.php?/$1 [l] #checks see if user attempting access valid file, #such image or css document, if isn't true sends #request index.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?/$1 [l] </ifmodule> <ifmodule !mod_rewrite.c> # if don't have mod_rewrite installed, 404's # can sent index.php, , works normal. errordocument 404 /index.php </ifmodule>
Comments
Post a Comment