We're having trouble with 1 out of 7 virtualhost configurations: trying to get
http://example.com to resolve to
http://www.example.com.
We have 7 domains setup in linode, DNS records all configured the same, with A/AAAA records all pointing to the same linode (same IP). The DNS record is set up for the domain without www. prefix.
The linode is running Ubantu 9.1.
There are virtualhost files for all 7 domains in /apache2/sites-available, and all have been enabled via a2ensite.
Here is a template of the virtualhost file from sites-enabled, where "example" is replaced with the domain name. All sites have the same DocumentRoot (drupal multisite install).
The
http://example.com->
http://www.example.com rollover is working of 6 out of the 7 domains so configured. The question, what might be the problem with the 1 that won't behave?
<virtualhost *:80>
# Admin email, Server Name (domain name) and any alias
ServerAdmin
admin@example.com
ServerName example.com
ServerAlias
www.example.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/webroot
<Directory /var/www/webroot/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)
http://www.%{HTTP_HOST}:%{SERVER_PORT}/$1 [L,R]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$
http://www.%{HTTP_HOST}/$1 [R=301,L]
#Drupal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
# Custom log file locations
LogLevel warn
ErrorLog /var/log/example/error.log
CustomLog /var/log/example/access.log combined
</virtualhost>
I tried deleting an recreating the DNS record.
I tried adissite disabling the site (it becomes unavailable), then reenabling (aensite) (it becomes available).
Where might I look for clues?
Thanks!