The complete .htaccessfile
RewriteEngine on
RewriteBase /
RewriteRule ^([a-z0-9_\-]+)/([a-z0-9_\-]+)/(index\.php)?$ /main.php?type=$1&action=$2 [NC,QSA,L]
so,
www.server.com/users/new/
redirects to:
www.server.com/main.php?type=users&action=new
The rule works fine on my test machine.
However,
on another machine, it fails if there is a file that starts with the same name:
/
|- main.php
|
+--[users]
|- new.inc.js
requesting
www.server.com/users/list/ --> 200 OK (main.php returns results as expected)
www.server.com/users/new/ --> 404 Not Found
If I remove `new.inc.js' the request will be redirected as expected.
What configuration flag causes this behaviour?
(I've been banging my head against the wall for some time now)
Update
(I added the complete .htaccess file contents)
index.html
and index.php
are the directory indexes
(And it does not make sense to me either :()
Do you have
mod_negotiation
installed? If so, that'll take your request for new and try to work out what file you really meant to send. Make sure you don't haveOptions MultiViews
set. So, in the.htaccess
putOptions -MultiViews
.