Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 tl:dr; How would you go about tracking down a url rewrite that should not be happening?

The details: I have one .htaccess file and it is simply:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]

Rewrite is enabled. When I visit a url like the following: I get what I expect. however will redirect to

So in my app route like will become

Where could this be getting set? I thought it could be in my vhosts file but that looks like:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

which looks pretty vanilla to me. I then though is could be my DirectoryIndex (located in apache2's mods-enabled directory) needed to be specified so I changed that to:

<IfModule mod_dir.c>

          DirectoryIndex index.php index.phtml index.html


But no luck. I'm not sure where else to look. Any suggestions?

share|improve this question
up vote 1 down vote accepted

Activate debug logging in your logging environment and call that URL. Apache should create a detailed log where it went down the road. At least that's what nginx does in debug mode.

I have no clue why this is happening, but you could try:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

Instead of your rewrite which checks the other way around. MultiViews could also be a problem.

share|improve this answer

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.