Removing index.php using codeigniter 2 -
i want remove 'index.php' link url project folder return error 404 page not found.
default url is:
http://localhost/training/belajaradmin/
, working fine. url
http://localhost/training/belajaradmin/index.php/login
but, when put url remove index.php:
http://localhost/training/belajaradmin/login
code not work.
im using codeigniter 2.2.6. code below name of file , changes have made.
.htaccess @ root
rewriteengine on rewritecond $1 !&(index\.php|resources|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa]
config.php in 'application' folder
$config['base_url'] = 'http://localhost/training/belajaradmin/'; $config['index_page'] = '';
autoload.php in 'application' folder
$autoload['helper'] = array('url');
routes.php in 'application' folder
$route['default_controller'] = "login";
in .htaccess add following line after rewriteengine on
rewritebase /training/belajaradmin/
edit config follows:
$config['base_url'] = ''; $config['index_page'] = '';
Comments
Post a Comment