Forum Moderators: open
When I try to access a forbidden page using Wannabrowser with a blocked UA, I see my Host's generic Apache 403 page, with the addition at the bottom that a call to to custom ErrorDocument created an error. Of course no help is provided about this error. I have CHMODed the file to 744 as required to parse the SSI directive, with XBitHack On. I have commented out the SSI hitcounter call to no avail. I have copied and CHMODed the file to the root, with no affect. It always creates an error at the bottom of the Apache 403 Forbidden message.
I also have a custom 404, in the same directory, which works perfectly (at 644).
Below are the contents of the failed 403 page. I apologize in advance for the length of the post.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>403 Access Denied</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="robots" content="noindex,nofollow,noarchive">
<style type="text/css">
<!--
(SNIP)
-->
</style>
<base href="http://www.wizcrafts.net">
</head>
<body>
<h1 class="c">ACCESS DENIED!</h1>
<h3>Your access to our website has been blocked for one or more of the following reasons:</h3>
<ol>
<li>You have attempted to view a file or directory that is marked off-limits to the public</li>
<li>Your User-Agent is on our list of banned email harvester bots (Go Away!)</li>
<li>You are using a website downloader program that we have prohibited for bandwidth or copyright reasons</li>
<li>Your IP address is blacklisted, or is part of a block of blacklisted IP addresses, usually of spammer-friendly ISPs</li>
<li>You are, or you sent an indexing spider that we do not want to traverse or index our website</li>
</ol>
(Big text SNIP)
<hr>
<address>Wizcrafts Computer Services © 2000-2003 <a href="http://www.wizcrafts.net/contact-info.html" title="Bot Trap! DO NOT click this link!"></a></address>
<!--#include virtual="/cgi-bin/MKCounter.cgi?id=403&hidden=0&count=1&log=1"-->
</body></html>
I have had to turn this line off in .htaccess for now. Any assistace will be appreciated.
The problem is likely to be in your .htaccess file, specifically in the RewriteRule(s) which invoke(s) the 403.
Since you are calling a custom 403 page, and it in turn is calling several includes, all of those files must be allowed to be accessed, regardless of the user-agent, IP address, etc. Otherwise, you end up in a 403-Forbidden loop, since access to these files themselves is also forbidden.
A simple example would be:
RewriteCond %{HTTP_USER_AGENT} ^Indy.Library [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget
RewriteRule !^(includes/403\.html¦cgi-bin/MKCounter\.cgi¦robots\.txt) - [F]
Note that "¦" characters get modified in posts on this board - change them to solid vertical pipe characters before use.
HTH,
Jim
I just added the Rewrite rule you supplied and it works perfectly. Thanks again.
Wiz
RewriteCond %{HTTP_USER_AGENT} ^Indy.Library [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget
RewriteRule!^(includes/403\.html¦cgi-bin/MKCounter\.cgi¦robots\.txt) - [F]
I don't use an error page. Rather the standard server/browser default.
Would the following be correct if I desired the 403's to allow viewing of robots?
RewriteCond %{HTTP_USER_AGENT} ^Indy.Library [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget
RewriteRule!^(includes/403¦cgi-bin/MKCounter\.cgi¦robots\.txt) - [F]
TIA
Don
Correct me if I am wrong.
I once thought I was wrong, but I was mistaken!
Wiz
RewriteCond %{HTTP_USER_AGENT} ^Indy.Library [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget
RewriteRule!^(includes/403¦cgi-bin/MKCounter\.cgi¦robots\.txt) - [F]
Wiz
So is should the lines I desire read:
RewriteCond %{HTTP_USER_AGENT} ^Indy.Library [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget
RewriteRule!^(403¦robots\.txt) - [F]
Which would hopefully allow 403's to read robots?
coding be adjusted to display literally as typed?
It's something with software used for this forum and the options of styles.
Sorry I can't provide a URL however one can only assume if the configurations were an option it would have been resolved long ago.
at times a space is also omitted between }and ^.
Don
Don,
You don't need the "403¦" in this line unless you have a custom 403 error page named "403" with no file extension.
RewriteRule !^(403¦robots\.txt) - [F]
All you need is:
RewriteRule !^robots\.txt$ - [F]
You can get a space before "!" to stay in your posts if you type TWO spaces.
Jim