[英]Adding localhost subdomains in apache virtual hosts
I am trying to redirect all subdomains of hothouse to go to hothouse\\testsite, but I cannot get it to work. 我正在尝试将温室的所有子域重定向到“温室\\测试站点”,但无法使其正常工作。
I dont understand the difference between DocumentRoot and VirtualDocumentRoot, not sure if that makes any difference. 我不了解DocumentRoot和VirtualDocumentRoot之间的区别,不确定是否有任何区别。
Any ideas why it is not working 'testsite.hothouse' redirects fine. 任何想法,为什么它不工作'testsite.hothouse'重定向很好。 'test.hothouse' or any subdomain.hothouse does not (redirects to 'www.subdomain.hothouse').
'test.hothouse'或任何subdomain.hothouse都不(重定向到'www.subdomain.hothouse')。
I have spent all day trying to work this out I have cleared all my browser caches. 我已经花了一整天的时间来解决这个问题,我已经清除了所有浏览器缓存。 BTW I am using WAMP
顺便说一句我正在使用WAMP
DocumentRoot "D:\wamp\www"
<Directory "D:\wamp\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot "D:\wamp\www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
VirtualDocumentRoot "D:\wamp\www\hothouse\testsite"
ServerName testsite.hothouse
ServerAlias test.hothouse
</VirtualHost>
<VirtualHost *:80>
VirtualDocumentRoot "D:\wamp\www\hothouse\testsite"
ServerName subdomain.hothouse
ServerAlias *.hothouse
</VirtualHost>
问题不是apache设置,但是我没有更新Windows主机文件以重定向到localhost。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.