我正在尝试使用域在 wamp 中访问我的 Laravel 项目lsapp.test
。我可以使用 访问该站点localhost/lsapp/public
,但是当我使用上述内容时,我会被发送到 wamp 主页。
这是使用 Apache 2.4.33、PHP 7.2.4 的 Wamp 3.1.3 版。这是我的 httpd-vhosts 文件。
<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>
编辑:设置vhosts后重启Apache服务器生效
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句