【发布时间】:2020-11-25 12:32:19
【问题描述】:
目前正在尝试在我的本地 PC 上设置 Laravel 项目。我将主机名 127.0.0.1 localhost-smt 添加到 Windows 主机文件并编辑了我的 Apache httpd- vhost.conf:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs/project1"
<Directory "C:/xampp/htdocs/project1/">
DirectoryIndex index.php
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost-smt
DocumentRoot "C:/xampp/htdocs/project1/smt/public"
ErrorLog "logs/testseite-error.log"
CustomLog "logs/testseite-access.log" common
<Directory "C:/xampp/htdocs/project1/smt/">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
我的 Apache httpd.conf
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
每次我连接到 localhost-smt/home 时,我都会收到一个双重 URL,例如 http://localhost-smt/127.0.0.1/home。此外,如果我从 localhost 导航到公用文件夹并添加 /home,我会收到以下 URL http://localhost/smt/public/ 127.0.0.1/smt/public/home.
我尝试了很多不同的解决方案,但到目前为止都没有奏效。如果有人能帮我解开这个谜题,我将不胜感激。
【问题讨论】:
标签: php laravel apache error-handling