I have a multi-site installation (drupal 5.14) with 6 sites. All sites are accessible via http://example.com and via http://www.example.com. But since this morning, suddenly one of the 6 sites is only available via http://www.example.com (but all other 5 sites are still working with and without www).

A request for http://example.com/anything produces an error 404: The requested URL /anything was not found on this server. I request for http://example.com is redirected to the default virtual apache server.

In the apache log, I am getting an error message "File does not exist: /var/www/anything". (/var/www is DocumentRoot of the Apache default virtual server). However documentRoot of example.com is /usr/other-path/drupal/html.

Example:
Working: http://www.timeforchange.org/modesty
not working any more: http://timeforchange.org/modesty

Since all other 5 sites are accessible with and without www, it can't be a problem of the .htaccess file. Nevertheless, I copied the original .htaccess over the existing one - still no change. I then enabled the following 2 lines in the .htaccess file:
RewriteCond %{HTTP_HOST} ^timeforchange\.org$ [NC]
RewriteRule ^(.*)$ http://www.timeforchange.org/$1 [L,R=301]
Strange enough, this did not change anything. However when I set RewriteEngine off in the same .htacess file, drupal doesn't work properly any more. So I concluded that the .htacess file is being read by Apache2.

I then copied the Apache virtual server configuration file from a drupal site, which is still accessible with and without www and only modified the entries for Servername (to timeforchange.org) and Serveralias (to www.timeforchange.org). But I have still the same behaviour.

What could be cause for this (I have root accessto the server)? Please help!

Thank you in advance
Juerg

Comments

juerg’s picture

After replacing Servername with the ServerAlias and vice versa in the Apache virtual Server configuration document, the above mentioned rewrite rule in .htaccess was evaluated. So I removed the Rewrite rule again and everything was working as it should.

I have reloaded the Apache2 configuration x-times, I have rewritten the virtual server configuration file from scratch, I have restartet the Apache Server serveral times and I have even rebooted the server. The only change, which helped was exchanging the Servername and Serveralias.