AH01630:服务器配置.htaccess拒绝客户端

问题描述 投票:0回答:1

我遇到此错误,我无法解决。我输入

tail -f / usr / local / apache / logs / error_log

在cpanel终端上,我收到以下错误:

[authz_core:错误] [pid 10250]

这是我的.htaccess代码:

<IfModule authz_core_module>
    Require all granted
</IfModule>
<IfModule !authz_core_module>
    Require all denied
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

我无法在我的vps服务器(hostgator Apache 2.4.41)中打开php文件,而不是打开该文件,而是下载了它。

php apache .htaccess vps
1个回答
1
投票

这对我有用,请根据您的要求进行编辑

</VirtualHost>
<Directory /var/www/html/example.com/public_html>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>

客户端被服务器配置拒绝

此错误意味着Apache配置拒绝了对文件系统目录的访问。

开始之前

在尝试更改任何现有配置文件之前,请注意拒绝访问的完整文件系统路径,以及客户端的IP或主机名:

[<date here>] [error] [client ::1] client denied by server configuration: /var/www/example.com/

对于以下示例,在目录块中使用正确的路径对于解决此问题至关重要。在这种情况下,将拒绝来自本地计算机(:: 1)的客户端访问[/var/www/example.com][1]

这样的事情应该可以解决您的问题:

<Directory /var/www/example.com>
  Order allow,deny
  Allow from all
</Directory>

或者这一个

<Directory /var/www/example.com>
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

更多说明:

https://cwiki.apache.org/confluence/display/httpd/ClientDeniedByServerConfiguration

© www.soinside.com 2019 - 2024. All rights reserved.