0
votes

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>
1
given you can't use apache on google-app-engine what exactly are you asking? Are you running an apache server and want to block incoming requests from GAE instances?Paul Collingwood
nope, I am using a VPS server and I already blocked appengine successfully but when i access for example xxx.appspot.com/mydomain.com i get the 500 error trying to access the 403-forbidden.html file. I want to show the 403-forbidden.html page when someone access my website via appspot.comAnas Zine
Well, the error says that an internal error occured while trying to show the document pointed at by ErrorDocument. The obvious start is by looking in your Apache error log to see what it logged. I am guessing it might try to forbid showing /403-forbidden.html as part of the ErrorDocument for that error,Sumurai8
yes that's the problem but how to allow showing 403-forbidden.htmlAnas Zine

1 Answers

1
votes

Try to add, before your first RewriteCond:

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