我是一名Web開發人員,經常希望查看本地計算機上的不同項目。目前我的本地主機設置爲「C:/ xampp/htdocs /」。我想創建一個指向「C:/ xampp/htdocs/company /」的「company.localhost」。本地主機,子域,使用XAMPP
我已經編輯C:\ WINDOWS \ SYSTEM32 \ DRIVERS \等\主機包括行
127.0.0.1 company.localhost
我已經編輯C:\ XAMPP的\ apache的\的conf \額外\的httpd-vhosts.conf來包括
<VirtualHost *:80>
ServerName company.localhost
ServerAlias company.localhost
DocumentRoot "C:/xampp/htdocs/company/"
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
當我瀏覽到http://company.localhost在我的瀏覽器(使用Chrome),它讓我看到本地主機索引頁。我已經啓動並重新啓動了我的Apache服務器。我如何在瀏覽器中訪問company.localhost/index.php?
我在Windows 7
編輯:現在無論是http://localhost和http://company.localhost都指向索引頁company.localhost。我如何獲取正常的本地主機索引並仍然保留company.localhost的正確索引頁?
謝謝。
也許有幫助,在Windows上使用\而不是/ – lmarcelocc 2015-02-24 17:02:36
我被複制的虛擬主機文件中的例子,但我給它一個鏡頭。編輯:現在它告訴我網頁不可用。 – ShiningLight 2015-02-24 17:04:14
使用反斜槓代替正斜槓會導致Apache突然停止的錯誤。 – ShiningLight 2015-02-24 17:10:51