我正在尝试使用我的其他域名

时间:2016-09-04 08:02:57

标签: http xampp vhosts

我刚刚获得了一个新域名,我正在尝试将其用于其他网站,但我无法让它工作。它仍然将我发送到我的其他域名。我试着去查看怎么做但是我找不到它去做,我该怎么办?这是代码,

ServerName dstokesncstudio.org


<VirtualHost 69.132.203.191:80>
 ServerName dstokesncstudio.org:80
 ServerAlias www.dstokesncstudio.org
 DocumentRoot "C:/htdocs/www/dstokesncstudio"
 DirectoryIndex index.html

 TransferLog "C:/htdocs/www/dstokesncstudio/logs/access.log" 
 ErrorLog "C:/htdocs/www/dstokesncstudio/logs/error.log"

 <Directory "C:/htdocs/www/dstokesncstudio">
  DirectoryIndex index.html
  Options Indexes FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
 </Directory>


 </VirtualHost>


ServerName dejesusconstruction.com
<VirtualHost 69.132.203.191:8080>
ServerName www.dejesusconstruction.com:8080
ServerAlias www.dejesusconstruction.com
DocumentRoot "C:/htdocs/www/dstokesncstudio/jesus"
DirectoryIndex index.html


<Directory "C:/htdocs/www/dstokesncstudio/jesus">
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

</VirtualHost>



 <VirtualHost 69.132.203.191:80>
 ServerName dstokesncstudio.org

</VirtualHost>

<VirtualHost 69.132.203.191:8080>
ServerName dejesusconstruction.com

</VirtualHost>

1 个答案:

答案 0 :(得分:0)

作为

  

http://ping.eu/nslookup/

dstokesncstudio.org     => 216.239.38.21,216.239.32.21,...
dejesusconstruction.com => 216.239.38.21,216.239.32.21,...

不是69.132.203.191

我认为您需要基于名称的虚拟主机https://httpd.apache.org/docs/2.4/vhosts/name-based.html

在您的情况下,移除ServerName ...之外的VirtualHost ...并添加到顶部

NameVirtualHost *:80
NameVirtualHost *:8080

如果您还想在端口80上访问第二个域,那么您不需要第二行。

现在从VirtualHost中移除IP,如上面的链接所描述的那样,您应该到达域名。