wamp伺服器vhosts位址前往google搜尋頁面

wamp伺服器vhosts位址前往google搜尋頁面

我的虛擬主機檔案:

<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "C:/wamp64/www/"
  <Directory "C:/wamp64/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

和專案虛擬主機:

<VirtualHost *:80>
   ServerName www.tour.test
   DocumentRoot "C:/wamp64/tour/public"
    SetEnv APPLICATION_ENV "development"
    <directory "C:/wamp64/tour/public">
        DirectoryIndex index.php
        AllowOverride all
        Order Allow,Deny
        Allow from all
    </directory>
</VirtualHost>

答案1

假設我沒有誤解你的問題,有兩個可能的罪魁禍首:

關於尾部斜杠,這是當前版本的 Chrome、Firefox 和 Opera 本地域所必需的(儘管localhost不需要這種處理)。

關於 ServerName/ServerAlias 指令還有兩個小問題:

  • 您的localhost條目實際上並不需要該ServerAlias localhost指令。

  • 您的www.tour.test主機條目應該(可以說)以如下方式開頭:

    ServerName tour.test
    ServerAlias www.tour.test, *.tour.test

相關內容