Welcome Guest, Not a member yet? Register   Sign In
htaccess, redirect from folder/index.php to folder/ ... how?

I want to redirect to the root if someone accesses /controller/index.php ... if for whatever reason someone would put index.php on the end of the url. I just want it to go back to the root.

http://www.somesite.com/controller/index.php -> http://www.somesite.com

RewriteEngine on

RewriteCond %{THE_REQUEST} /index\.php
RewriteRule ^(.*)$ / [R=301,L]

RewriteCond $1 !^(crossdomain\.xml|index\.php|robots\.txt|css/|images/|scripts/)
RewriteRule ^(.*)$ /index.php/$1 [L]

I get the error "No input file specified."


Have you set a default controller in your /config/routes.php ?

I have. The site is running no problem. URLs are like http://www.somesite.com/controller/ ... Just looking to remove index.php off the tail if someone puts it on.

Theme © iAndrew 2016 - Forum software by © MyBB