httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [users@httpd] mod_rewrite - Problem with syntax on rule
Date Wed, 23 Jun 2004 22:08:37 GMT
I hope someone could help me with a syntax issue I have on one of my rules
(at least I think its a syntax issue)

Here is a copy of what I currently use in my httpd.conf

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteLoglevel 99
RewriteLog /var/log/rewrite_log
RewriteMap      hosts-redirect
#RewriteCond   ${hosts-redirect:%{REMOTE_ADDR}|NOT-FOUND}
RewriteCond   %{REMOTE_ADDR}    ^192\.168\.168\.[2-254]$
RewriteRule ^/.* [R,L]

What I am trying to do is take IP's in a class C (in this case and redirect them to another site.

Now the commented out RewriteCond rule does work just fine IF I place each
IP in the file.

Example of my hosts-redirect txt file: - - -

etc etc

That does work just fine.

The second RewriteCond does not work.  Here is a snipet from my
rewrite_log: - - [23/Jun/2004:21:21:25 +0000]
[][rid#80e0d24/initial/redir#1] (4)
RewriteCond: input='192.168.
168.2' pattern='^192\.168\.168\.[2-254]$' => not-matched --

As you can see it is attempting to match the exact string in my
RewriteCond line, I can only assume this is a syntax issue.  The
mod_rewrite doc has a similar example for host deny as that line so I
assumed that is valid syntax when I wrote it, obviously I am missing

Help list!

Thanks for your time.


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