On May 13, 2011 11:08 , Carmel <carmel...@hotmail.com> wrote:
I am using a "htaccess" file to limit certain IP from accessing my
server. This is the format of the file:

<Limit GET HEAD POST>
order allow,deny
deny from X.X.X.X
allow from all
</Limit>

This is working perfectly. Is there anyway I can have a custom message
displayed when a site listed in the above file is blocked?

First, what you have above allows HTTP methods other than the three you list. If you want to block all access from the above IP addresses, you should get rid of the Limit stanza and just put the Order, Allow, and Deny directives directly in the .htaccess file.

The ErrorDocument directive will allow you to control what the server returns to the client when access is denied:

http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

You'll want to set up an ErrorDocument for the 403 status code. If you include the ErrorDocument directive in your .htaccess file, it will only apply to resources at and below that level.

--
  Mark Montague
  m...@catseye.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to