Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have Apache multiviews enabled on my site but it's causing an unexpected behaviour.

my site www.example.com has an images folder like www.example.com/imgs/ where I store all images

so if I have www.example.com/imgs/pic1.jpg there and I try to access it, it's all fine and it shows the image on my browser.

Now if I go ahead and delete pic1.jpg from the imgs folder, and try to access www.example.com/imgs/pic1.jpg again, I was expecting a 404 but somehow I get served the page www.example.com/index.php (although css styling is lost). It's not a redirect, the URL in the address bar still shows www.example.com/imgs/pic1.jpg but loads the script at www.example.com/index.php

I suspect it's something related to multiviews, my htaccess has only the multiviews option. So how can I fix this? And why apache+multiviews would serve the site's index.php script one folder above?


Just to mention that a request to www.example.com/script corretly loads www.example.com/script.php

share|improve this question
What is the content of your .htaccess? –  Michael Hampton Feb 24 '13 at 2:33
It only has: Options +MultiViews and nothing else –  Thomaz Ebihara Feb 24 '13 at 2:48
No, the other .htaccess at your top level. And your Apache virtualhost configuration while you're at it. –  Michael Hampton Feb 24 '13 at 3:06
@Michael example.com is an addon domain to primarydomain.com which is a shared hosting acct - i'm not sure if you mean the .htaccess file on the primarydomain.com but here it is # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress –  Thomaz Ebihara Feb 24 '13 at 3:21
Please edit your question to add the config there instead of in a comment, it's really hard to read without proper formatting. –  Jenny D Feb 25 '13 at 10:34

1 Answer 1

up vote 0 down vote accepted

I've found what was causing this behaviour. As Michael mentioned, it was the primary domain's .htaccess affecting the add-on domain. In my case the solution was simple because I don't need rewrite rules in the add-on domain directory so I just added a line to the .htaccess file for the add-on domain:

RewriteEngine Off

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.