Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

.htaccess deny special error pages

Is this possible?



6:26 pm on Oct 31, 2010 (gmt 0)

10+ Year Member

I have something like this in a site's htaccess

<Limit GET POST>
order allow,deny
deny from xx.xx.xx.xx
deny from xx.xx.xx.xx
allow from all

I am going to add a range

deny from xx.xx.xx.*

But I would like only the users of this range of blocked IPs to see a special error page for them.

Is this possible?


3:43 pm on Nov 2, 2010 (gmt 0)

10+ Year Member

Hi georgeek --

I think you may have the wrong approach here. See the docs on the use of the <Limit> section ... it pretty much comes out and says not to do what it looks like you're doing :-) [httpd.apache.org...]

The idea of using allow and deny is fine in general, but I think in your case, you want to respond specially to an IP address range by returning a special page. Take a look here in the doc for a couple of approaches to consider. [httpd.apache.org...]

I think you may want to look at RewriteRule and RewriteCond -- the condition is that the requesting IP address matches a range, and RewriteRule would be to send a 403 response and a specific page back.

Take a whirl after reading the docs, and also search here for examples of cases where people have done the same thing. If you're out of luck after that, please let us know what you're trying to accomplish (why is this IP address range special, what kind of message, etc.).



4:06 pm on Nov 2, 2010 (gmt 0)

10+ Year Member

Tom that is very helpful, thank you.

Featured Threads

Hot Threads This Week

Hot Threads This Month