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里的,



    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
    
     RewriteEngine on
    # 如果请求的是真实存在的文件或目录,直接访问
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # 如果请求的不是真实文件或目录,分发请求至 index.php
    RewriteRule . index.php
   


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


    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted

或在上面的VirtualHost里加上这一段,

然后重启xampp,问题解决。

你可能感兴趣的:(运维-Nginx/Apache)