CodeIgniter always routes via index.php?
Beginner CodeIgniter. My site's main url is http: // localhost / routing / '.
// config.php
$config['base_url'] = 'http://localhost/routing/';
I'm just trying to redirect the url http: // localhost / routing / admin 'to the admin controller using the following rules, but it doesn't work, I have to use' http: //localhost/routing/index.php/admin ' instead ...
$route['default_controller'] = 'seasons';
$route['admin'] = 'admin';
$route['404_override'] = '';
Question : is there a way to remove 'index.php' from url?
+3
source to share
3 answers
Is there a way to remove 'index.php' from the url?
Yes, and also a very popular SO question , it is covered in the CodeIgniter documentation (which is very good and I highly recommend reading it).
+4
source to share
In yours, .htaccess
write this. Also find more information: Coding Guide
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt) # exceptions
RewriteRule ^(.*)$ /index.php/$1 [L]
0
source to share