httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <>
Subject Re: [users@httpd] Custom Message
Date Fri, 13 May 2011 16:02:34 GMT
  On May 13, 2011 11:08 , Carmel <> wrote:
> I am using a "htaccess" file to limit certain IP from accessing my
> server. This is the format of the file:
> 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:

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

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message