Forum Moderators: phranque
I want to rewrite http_//mydomain.com/f to http_//mydomain.com/
This is my .htaccess code:
Rewriterule ^f$ / [R=301,L]
rewrite works, but if exists a file called f.php, then doesn't work (I have 404 error when f.php exists)
I tried to do this:
RewriteCond %{REQUEST_FILENAME} !-f
Rewriterule ^f$ / [R=301,L]
also I tried to do this:
Rewriterule ^f([^\.php])$ / [R=301,L]
But doesn't work. I need help Is possible this rewrite? or I should delete f.php file? Please help me Thanks
If you're on Apache 2.x, disable MultiViews and disable AcceptPathInfo (unless you use them).
Directives:
Options -MultiViews
AcceptPathInfo Off
RewriteRule ^f$ [i]http://www.example.com[/i]/ [R=301,L]