XAMPP提示 Access forbidden情况的处理

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>


然后重启xampp,问题解决。

你可能感兴趣的:(Web,Access,xampp)