【发布时间】:2018-07-08 20:37:03
【问题描述】:
我遇到了一个看似常见的问题,但我发现的任何解决方案似乎都不适用于我的情况。
我正在尝试设置一个虚拟主机,以便我可以通过转到“walkpeakdistrict.local”来访问我的 Laravel 安装的公共文件,但是当我在谷歌浏览器中输入这个地址时,我总是被重定向到 xampp 仪表板在这个地址“https://walkpeakdistrict.local/dashboard/”。
我已将 Laravel 安装在以下 xampp 目录中:c:/xampp/htdocs/walkpeakdistrict_uk。
我的“C:\xampp\apache\conf\extra\httpd-vhosts.conf”设置如下:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/walkpeakdistrict_uk/public"
ServerName walkpeakdistrict.local
</VirtualHost>
我的“C:\Windows\System32\drivers\etc\hosts”设置如下:
127.0.0.1 localhost
127.0.0.1 walkpeakdistrict.local
如果有人能提供对此问题的任何见解,我将不胜感激。
【问题讨论】:
-
在“httpd.conf”中,你做了
Include "C:\xampp\apache\conf\extra\httpd-vhosts.conf吗?另外,你修改的时候有没有重启过网络服务器?
标签: php laravel apache xampp virtualhost