Custom 403 Page Problem

Custom 403 Page Problem

Posted by: ozort
Posted on: 2006-08-19 08:06:00

I'm trying to display a customised 403 error for a specific user that i'm particularly sick of. I want it to refer to him by name, as well as a personal message as to why he's been banned.

Right now my code is:
[code]
ErrorDocument 403 /errors/blocked.php
Order Allow,Deny
Allow from All
Deny from x.x.x.x
[/code]

However, it is unable to find this error message and just gives a general generic apache 403 message.

HOWEVER, i know the file is there, because if i preface it with
[code]
<files index.html>
...
</files>
[/code]

the it blocks access to "index.html", but then allows it for all other files.

If anyone can help me straighten this out, i'd appreciate it!

Cheers!

Re: Custom 403 Page Problem

Posted by: Atropos7
Posted on: 2006-08-19 09:46:00

You just denied access to the entire site - including the custom error pages! Oh, and you were so close to figuring that out for yourself too with that Files directive.

You need another .htaccess file. And it needs to allow access. And as an exercise for the reader, I'm sure you know where this .htaccess file should go. And next time don't forget to check your error.log for error messages from Apache, it would have said something like:

client denied by server configuration: /home/username/errors/denied.php



cool Atropos | openvein.org

Tags: denyerror messageprefacesickapachephp403 error