Welcome to WebmasterWorld Guest from 54.198.87.238

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Blocking ip on cluster server

How to optimize .htaccess file

     
8:35 pm on Feb 24, 2009 (gmt 0)

10+ Year Member



I use cluster server and below is only option to Block IP's.
Is there a way to make the very long file shorter?
How can I block an IP range with this method?

SetEnvIf X-Cluster-Client-Ip 11.1.11.111 block
SetEnvIf X-Cluster-Client-Ip 11.1.11.112 block
SetEnvIf X-Cluster-Client-Ip 11.1.11.113 block
SetEnvIf X-Cluster-Client-Ip 11.1.11.114 block
SetEnvIf X-Cluster-Client-Ip 11.1.11.115 block
SetEnvIf X-Cluster-Client-Ip 11.1.11.116 block
'
'
Deny from env=Block

9:43 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I don't have a clue what cluster server is!

#SHOULD deny 11.1.11.0-2555
SetEnvIf X-Cluster-Client-Ip 11.1.11. block

10:02 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



SetEnvIf uses regular expressions, so

SetEnvIf X-Cluster-Client-Ip ^11\.1\.11\.11[1-6]$ block

replaces all six lines, as well as correcting the unanchored pattern and un-escaped literal periods.

This assumes that the X-Cluster-Client-Ip variable is defined within the scope where this SetEnvIf directive executes.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month