I am having an extremely bizarre issue that seems only present on Chrome, IE and Firefox are fine. I have 2 website being served by 1 IP address, I have 2 identical files in sites-available named site1.com and site2.com. I run the a2ensite command to create the links to sites-enabled.
All redirections are working perfectly, except for site1.com using Chrome.
On Chrome, if I type www.site1.com it redirects me to the right folder /var/www/site1.com , if I type http://site1.com it redirects me to the wrong folder /var/www
Now this is where it gets bizarre, when I type www.site2.com it redirects me to /var/www/site2.com and when I type http://site2.com it redirects me correctly to /var/www/sites2.com
What I don't get, is the virtual host files are identical bar the actual ServerName & Alias and log locations.
Site1
<VirtualHost *:80>
ServerAdmin webmaster@site1.com
ServerName site1.com
ServerAlias www.site1.com
DocumentRoot /var/www/site1.com
#<Directory />
# Options FollowSymLinks
# AllowOverride None
#</Directory>
#<Directory /var/www/site1.com>
# Options Indexes FollowSymLinks MultiViews
# AllowOverride None
# Order allow,deny
# allow from all
#</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog /var/www-logs/site1.com/error.log
CustomLog /var/www-logs/site1.com/access.log combined
</VirtualHost>
Site2
<VirtualHost *:80>
ServerAdmin webmaster@site2.com
ServerName site2.com
ServerAlias www.site2.com
DocumentRoot /var/www/site2.com
#<Directory />
# Options FollowSymLinks
# AllowOverride None
#</Directory>
#<Directory /var/www/site2.com>
# Options Indexes FollowSymLinks MultiViews
# AllowOverride None
# Order allow,deny
# allow from all
#</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog /var/www-logs/site2.com/error.log
CustomLog /var/www-logs/site2.com/access.log combined
</VirtualHost>