Hi guys I’m having problems with the following virtual hosts:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.domain1.com
ServerAlias domain1.com *.domain1.com
DocumentRoot /var/www/vvr
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/vvr>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@domain2.com
ServerName www.domain2.com
ServerAlias domain2.com *.domain2.com
# Send servlet for context / jsp-examples to worker named worker1
JkMount / worker1
JkMount /domainDocuments worker1
# Send JSPs for context /jsp-examples/* to worker named worker1
JkMount /* worker1
JkMount /domainDocuments/* worker1
This configuration is working when I enter http://www.domain1.com, however when I try to access only the domain name:
http://domain1.com , The site is redirecting me to http://www.domain2.com? Why is this hapenning. Thanks alot.
Your VirtualHost definitions look good to me. You might check your .htaccess file to make sure there are no redirects sending domain1.com to http://www.domain2.com.