1
我想使用Wamp在本地主機上設置子域。我創建的子域名是store.localhost,現在我可以讓該子域名工作,但是當我使用localhost重定向到store.localhost時,其他任何東西都與localhost相關聯。所以只需http://localhost重定向到store.localhost。創建本地主機子域重定向所有本地主機鏈接
我的主機文件有以下幾點:
127.0.0.1 localhost
127.0.0.1 store.localhost
我的httpd-vhosts.conf文件有:
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/store"
ServerName store.localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
,我已經註釋掉在httpd.conf中關於虛擬主機的線路。
那麼我做錯了什麼?
定義的唯一虛擬主機是商店的虛擬主機。那麼我應該使用你在vhosts文件中發佈的內容嗎?我只是試了一下,而store.localhost的作品,我得到了404的其他東西。 – Griffin
沒關係,我似乎已經得到它的工作。我只是將servername localhost塊指向www目錄。謝謝你的幫助 :) – Griffin