Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The complete .htaccessfile

RewriteEngine on
RewriteBase /

RewriteRule ^([a-z0-9_\-]+)/([a-z0-9_\-]+)/(index\.php)?$ /main.php?type=$1&action=$2 [NC,QSA,L]


redirects to:

The rule works fine on my test machine.

on another machine, it fails if there is a file that starts with the same name:

|- main.php

requesting       --> 200 OK (main.php returns results as expected)        --> 404 Not Found

If I remove `' 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 :()

share|improve this question
Doesn't make sense to me yet from the information presented. Are there other RewriteRules? Is index.php set as the default index file? – Devin Ceartas Aug 21 '09 at 16:52
Just to be clear, requesting when <ROOT_DIR>/users/new/ exist give a 404 error ? Could you enable rewrite log and give us the result ? ( – radius Aug 21 '09 at 18:08
@radius: <document_root>/users/ exists. Unfortunately I can't enable anything. It took a lot of talking for me to get read access to the config files. – Jacco Aug 21 '09 at 20:23
up vote 7 down vote accepted

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 have Options MultiViews set. So, in the .htaccess put Options -MultiViews.

share|improve this answer
Thanks, right on target. – Jacco Aug 21 '09 at 20:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.