URL 指向不同的地方

URL 指向不同的地方

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>

相关内容