Access forbidden!

You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403
test.abc.net
Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3

当前的站点是定义在httpd-vhost.conf里的,

<VirtualHost *:8080>
ServerAdmin [email protected]
DocumentRoot “D:/Documents/abc/php/basic/web”
ServerName youai1.cm
ErrorLog “logs/abc.net-error.log”
CustomLog “logs/dummy-abc.net-access.log” common
<Directory “D:/Documents/abc/php/basic/web”>
RewriteEngine on
# 如果请求的是真实存在的文件或目录,直接访问
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 如果请求的不是真实文件或目录,分发请求至 index.php
RewriteRule . index.php
</Directory>
</VirtualHost>

这时在httpd.conf需要加上这一段代码:

<Directory “D:/Documents/abc/php/basic/web”>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>

或在上面的VirtualHost里加上这一段,
然后重启xampp,问题解决。
———————
作者:谢厂节
来源:CSDN
原文:https://blog.csdn.net/xundh/article/details/45664315
版权声明:本文为博主原创文章,转载请附上博文链接!

Leave a Comment

Your email address will not be published.