Forum Moderators: phranque

Message Too Old, No Replies

.hataccess not pulling up custom 403 page

do I need an override?

         

satchel

4:37 pm on Feb 11, 2010 (gmt 0)

10+ Year Member



Made a custom 403 page successfully a few years ago and it worked. Now not working. Thinking it's the path I'm using.

I want the denied IP addresses in my .htaccess to see the custom page instead of just generic "forbidden"

Put my IP in to test and received "forbidden" message plus: Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

In htaccess along with the banned iP addresses, I also put:

ErrorDocument 403 /www/htdocs/403.html

Tried at least 5 different ways and it won't pull it up. Surely it has to do with the path and I'm making this harder than it really is. Thanks all.

jdMorgan

6:44 pm on Feb 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Of course -- You are now forbidden from fetching documents from your server... including your 403 error document itself.

You must exclude your 403 error document from any and all access-control rules. I suggest you also do the same for your robots.txt file. To prevent problems, both of these files must be accessible to any client, regardless of access controls.

For mod_rewrite, use a negative-match RewriteCond on the rule(s). For mod_access controls, use the Deny,Allow order, match these two filepaths using SetEnvIf, and explicitly Allow access using the "Allow from env=" form of the Allow directive to override existing Deny directives.

Jim