我试图使用域lsapp.test
访问我的Laravel项目WAMP。我可以用localhost/lsapp/public
访问该网站,但是当我使用上面,我是送至WAMP首页。
这是对WAMP版本3.1.3与Apache 2.4.33,PHP 7.2.4。下面是我在httpd的虚拟主机文件。
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/lsapp/public/"
ServerName lsapp.test
</VirtualHost>
Windows主机文件:
127.0.0.1 localhost
::1 localhost
127.0.0.1 lsapp.test
::1 lsapp.test
我搜索了一段时间,但没能找到任何与此特定问题的帮助。
你应该有公共路径为DirectoryRoot为好。这是该格式。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "C:/wamp64/www/lsapp/public"
ServerName lsapp.test
ServerAlias *.lsapp.test
<Directory "C:/wamp64/www/lsapp/public">
Options All
AllowOverride All
Require local
</Directory>
</VirtualHost>
编辑:重新启动Apache服务器建立虚拟主机后生效