403 禁止。此外,尝试使用 Errordocument 处理请求时遇到 500 错误

403 Forbidden. Additionally, a 500 error was encountered while trying to use an Errordocument to handle the request

我正在让 appspot.com 代理废弃我的网站并让一些页面被 Google 索引,这意味着一些重复的内容问题。我成功地从我的网站以及 AppEngine-Google 中阻止了 appspot.com 域,但问题是当通过 appspot.com 访问我的网站时,我收到以下消息:

禁止

您无权访问此服务器上的 /。

此外,在尝试使用 ErrorDocument 处理请求时遇到了 500 Internal Server Error 错误。

我已经在 htaccess 中指定了 403 错误文件。这是阻止 appspot.com

的代码部分

我的问题是如何显示我的错误页面而不是此消息。

谢谢

    ErrorDocument 403 /403-forbidden.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]
RewriteRule ^(.*)$ - [F,L]
RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
RewriteCond %{QUERY_STRING} tag\= [NC,OR]
RewriteCond %{QUERY_STRING} ftp\:  [NC,OR]
RewriteCond %{QUERY_STRING} http\:  [NC,OR]
RewriteCond %{QUERY_STRING} https\:  [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>|ê|"|;|\?|\*|=$).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(&#x22;|&#x27;|&#x3C;|&#x3E;|&#x5C;|&#x7B;|&#x7C;).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F|127\.0).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(request|select|insert|union|declare).* [NC]
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
RewriteRule ^(.*)$ - [F,L]
</IfModule>

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{ENV:HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)/$ / [R=301,L]

RewriteCond %{HTTP_USER_AGENT} AppEngine-Google [NC] 
RewriteRule .* - [F]


RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} AppEngine-Google [NC]
RewriteRule .* http://zone-series.net [L,R=301]

RewriteCond %{HTTP_REFERER} http://jasmeet-js.appspot.com/ 
RewriteCond %{HTTP_USER_AGENT} AppEngine-Google\s~jasmeet-js
RewriteRule .? /403-forbidden.html [L]

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} AppEngine-Google [NC]
RewriteRule .* - [F]

RewriteEngine on
RewriteCond %{HTTP_REFERER} appspot.com [NC]
RewriteRule .* - [F]

RewriteCond %{HTTP_USER_AGENT} ^Baiduspider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Sogou
RewriteRule ^.*$ - [F]

BrowserMatchNoCase AppEngine-Google bad_bot
Order Deny,Allow
Deny from env=bad_bot
<Files 403-forbidden.html>
order allow,deny
allow from all
</Files>

尝试在您的第一个 RewriteCond 之前添加:

RewriteRule 403-forbidden\.html$ - [L]