0

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?

Thanks

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

5
  • What is the content of your .htaccess? Feb 24, 2013 at 2:33
  • It only has: Options +MultiViews and nothing else
    – ethmz
    Feb 24, 2013 at 2:48
  • No, the other .htaccess at your top level. And your Apache virtualhost configuration while you're at it. Feb 24, 2013 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
    – ethmz
    Feb 24, 2013 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, 2013 at 10:34

1 Answer 1

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .