WAMPサーバーのvhostsアドレスはGoogle検索ページに移動します

WAMPサーバーのvhostsアドレスはGoogle検索ページに移動します

私のvhostsファイル:

<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

私があなたの質問を誤解していないと仮定すると、考えられる原因は 2 つあります。

  • ローカルアドレスの末尾にスラッシュを入れるのを忘れています(例えば、http://example.test/ブラウザでは、http://example.test)。

  • あなたが持っていないドメイン名ローカルドメイン(例*.test:)に対して正しく設定します。

末尾のスラッシュに関しては、Chrome、Firefox、Opera の現在のバージョンではローカル ドメインにこれ​​が必要です (ただし、localhostこの処理は必要ないはずです)。

ServerName/ServerAlias ディレクティブに関する 2 つの小さな問題点:

  • あなたのlocalhostエントリには実際に指示は必要ありませんServerAlias localhost

  • ホストwww.tour.testエントリは、おそらく次のように始まるはずです。

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

関連情報