【发布时间】:2014-01-23 18:24:45
【问题描述】:
我知道这是一个很老的问题,但是在尝试找到正确的解决方案时我没有运气。我已经尝试了所有可能的配置,但仍然没有运气。我正在使用 laravel 开发 PHP 项目。将 laravel.labs 设置为 htdocs 内的虚拟主机时,我完全没有问题。但是当我将它移动到 C:\vhosts 的单独文件夹中时,我得到了这个 403 错误。 vhosts 文件夹的目的是保存多个 vhost。以下是我的配置:
系统: 视窗 7 64 位 XAMPP v 1.7.7 阿帕奇/2.2.21 PHP:5.3.8
httpd.conf:
# Virtual hosts
Include "conf/extra/httpd-vhosts.conf"
httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/laravel_labs/public
ServerName laravel.labs
</VirtualHost>
c:\windows\system32\driver\etc\host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 laravel.labs
.htaccess(在 C:\vhosts\laravel_labs\public 内)
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
谁能帮忙找到我错过的东西?有什么建议吗?谢谢
【问题讨论】:
标签: apache xampp http-status-code-403