views:

37

answers:

2

Hello, I was searching in Google this question very much time but I don't find any answer.

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 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

A: 

This will redirect any /f/(*) to /

 RewriteRule /f/(.*) /$1 [R,NE]
streetparade
thanks but does not worksI have a 404 error
zeldix
A: 

Ok, I find the solution I have to disable MultiViews directive

Options -MultiViews

then, rewrite works with file name "f.php" existing

zeldix