![URL 指向不同的地方](https://linux22.com/image/609450/URL%20%E6%8C%87%E5%90%91%E4%B8%8D%E5%90%8C%E7%9A%84%E5%9C%B0%E6%96%B9.png)
designer-school.com 指向我的根网站,但 www.designer-school.com 指向正确的文件夹。
这是我的虚拟主机文件
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html/main
ServerName www.joshhornby.co.uk
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/designerschool
ServerName http://www.designer-school.com
</VirtualHost>
我的 DNS 设置
http://cl.ly/image/2m2o442r393K
它们难道不应该指向同一个地方吗?
答案1
为 designer-school.com 添加一个 ServerAlias,因为现在,Apache 将为该 Vhost 返回的唯一内容是 www.designer-school.com:
<VirtualHost *:80>
DocumentRoot /var/www/html/designerschool
ServerName http://www.designer-school.com
ServerAlias designer-school.com
</VirtualHost>