I have the following routes in my routes file:
$route['default_controller'] = "main";
$route['404_override'] = '';
$route['testroute'] = "main";
As you can see all I want is when someone goes to mydomain.com/testroute it should just route back to the default controller. However when I go to that I get a 404 error. Am I doing something wrong in the way I'm writing this route?
You have to create the .htaccess
file in your app.
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
Please paste this code in your .htaccess file.
LoneWolfPR hit the nail on the head with his comment, you are using FastCGI which requires a different htaccess.
Can you try using this one?
https://raw.github.com/pyrocms/pyrocms/develop/.htaccess
I am tempted to propose we add it into CodeIgniter 2.1-dev to save this question coming up 15 times a day. Let me know if it works or fails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With