Anas Zine
Anas Zine

Reputation: 31

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

I am having the appspot.com proxy scrapping my website and having some pages indexed by Google, meaning some duplicate content issues. I successfully blocked the appspot.com domain from my website as well as AppEngine-Google, but the problem is when accessing to my website via appspot.com I am getting the following Message :

Forbidden

You don't have permission to access / on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I already specified the 403 error file in htaccess. Here's the portion of code that blocks appspot.com

My question is how can I make my error page show up instead of this message.

Thanks

    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 ^(.+)/$ /$1 [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>

Upvotes: 0

Views: 2088

Answers (1)

Croises
Croises

Reputation: 18671

Try to add, before your first RewriteCond:

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

Upvotes: 1

Related Questions