2016-09-04 36 views
1

我剛剛得到一個新的域名,我試圖用它爲一個不同的網站,但我不能得到它的工作。它仍然會將我發送給我的其他域名。我試圖查找它如何做到這一點,但我找不到做,我該怎麼辦?下面是代碼,我試圖用我的其他域名

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> 

回答

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,如上面的鏈接所述,並且您應該到達域。

+0

謝謝@Aleks我起初嘗試過,並且因爲某些原因沒有工作。 –

+0

現在它的話訪問禁止 –

+0

它仍然會去我的其他領域,但當我在手機上它去/它不說這個服務器上。 –

相關問題