httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sig Porter" <>
Subject [users@httpd] lexicographical rewritecond
Date Wed, 06 Sep 2006 03:12:48 GMT
I wanted to block a range of IPs. Since the documentation says if < 
or > precedes the CondPattern, then CondPattern is treated as a plain 
string and is compared lexicographically to TestString, I added the 
following to .htaccess:

RewriteCond %{REMOTE_ADDR} <
RewriteCond %{REMOTE_ADDR} >208.66.195.
RewriteRule .* - [F,L]

This did block the intended range, but also blocked other IPs, 

These do not seem to be lexicographically in the specified range.

I am not asking how to the block the range -- I have found a couple 
of workable methods. I am seeking an explanation of the 
"lexicographical" comparison.

As an example that is easier to test, I also tried 

RewriteCond %{QUERY_STRING} <
RewriteCond %{QUERY_STRING} >
RewriteRule .* - [F,L]

with http://example/?, giving the following in the rewrite 

RewriteCond: input='' pattern='<' => matched
RewriteCond: input='' pattern='>' => matched
forcing 'D:/example/' to be forbidden


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