httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
Subject Re: [users@httpd] Custom Message
Date Fri, 13 May 2011 16:02:34 GMT
  On May 13, 2011 11:08 , Carmel <carmel_ny@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
   mark@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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message