开发者

Virtual hosts redirecting incorrectly

开发者 https://www.devze.com 2023-03-27 06:36 出处:网络
Hi guys I\'m having problems with the following virtual hosts: <VirtualHost *:80> ServerAdmin webmaster@localhost

Hi guys I'm having problems with the following virtual hosts:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.domain1.com
ServerAlias开发者_StackOverflow中文版 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 www.domain1.com, however when I try to access only the domain name:

http://domain1.com , The site is redirecting me to 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 www.domain2.com.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号