私の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