我正在尝试根据主机名称(不是域名)将请求路由到不同的docroots:
<VirtualHost 123.123.12.12:80>
SuexecUserGroup "#521" "#521"
ServerName forum.somesite.net
DocumentRoot /home/somesite/public_html/forums
</VirtualHost>
<VirtualHost 123.123.12.12:80>
SuexecUserGroup "#521" "#521"
ServerName www.somesite.net
DocumentRoot /home/somesite/public_html
</VirtualHost>
虽然不行。无论主机名是什么,Apache似乎都会转到第一个条目。我做错了什么?
答案 0 :(得分:0)
尝试将第二个虚拟主机更改为此
<VirtualHost 123.123.12.12:80>
SuexecUserGroup "#521" "#521"
ServerName somesite.net
ServerAlias www.somesite.net
DocumentRoot /home/somesite/public_html
</VirtualHost>