![Xampp 將設定的虛擬主機重新導向到儀表板](https://rvso.com/image/760629/Xampp%20%E5%B0%87%E8%A8%AD%E5%AE%9A%E7%9A%84%E8%99%9B%E6%93%AC%E4%B8%BB%E6%A9%9F%E9%87%8D%E6%96%B0%E5%B0%8E%E5%90%91%E5%88%B0%E5%84%80%E8%A1%A8%E6%9D%BF.png)
我已經使用 XAMPP 很長時間了,我正在使用 Apache 來建立 PHP 網站。我有 5 個配置的虛擬主機,專案位於同一父目錄中,具有相同的虛擬主機配置和 DNS 設定。但我最後配置的虛擬主機,在訪問 url 後重定向到儀表板。
因此,在給瀏覽器 url: xxx.local 後,將重定向到地址:xxx.local/dashboard,我可以看到一些歡迎 html...
我不知道發生了什麼事。
在 Win10、Xampp 版本上運行7.2.15
C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 first.local
127.0.0.1 second.local
127.0.0.1 xxx.local
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/Projects/projectName/web/public_html"
ServerName xxx.local
ErrorLog "C:/Projects/projectName/logs/error.log"
CustomLog "C:/Projects/projectName/logs/access.log" combined
<Directory "C:/Projects/projectName/web">
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
專案位於 'web' 目錄中,index.php 檔案位於 'web/public_html' 中
同樣的方式我配置了更多虛擬主機並且它可以工作...
差別僅在於:
- 在目錄中,項目名稱為“.”
- 所有項目在「public」目錄中都有index.php,該項目在「public_html」中(配置為文檔根目錄)
更新:
如果我在存取 url: 'xxx.local' 後刪除檔案 'c:\xampp\htdocs\index.php' 我可以看到目錄 ('c:\xampp\htdocs') 內容。重量?