Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 44522 invoked from network); 23 Jun 2004 22:23:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jun 2004 22:23:15 -0000 Received: (qmail 62073 invoked by uid 500); 23 Jun 2004 22:23:17 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 61917 invoked by uid 500); 23 Jun 2004 22:23:14 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 61863 invoked by uid 99); 23 Jun 2004 22:23:12 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [205.207.148.251] (HELO aci.on.ca) (205.207.148.251) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 23 Jun 2004 15:23:11 -0700 Received: from nexus.sec.aci.on.ca([192.168.0.110] port=2645) (1916 bytes) by aci.on.ca([192.168.0.251] port=25) via TCP with esmtp (sender: ) id for ; (dest:remote)(R=bind_hosts)(T=inet_zone_bind_smtp) Wed, 23 Jun 2004 18:22:35 -0400 (EDT) (Smail-3.2.0.118 2004-May-31 #1 built 2004-May-31) Date: Wed, 23 Jun 2004 18:08:37 -0400 (EDT) From: jeff@aci.on.ca X-X-Sender: jeff@nexus To: users@httpd.apache.org Message-ID: <20040623175918.W24068@nexus> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked Subject: [users@httpd] mod_rewrite - Problem with syntax on rule X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 RewriteEngine on RewriteLoglevel 99 RewriteLog /var/log/rewrite_log RewriteMap hosts-redirect txt:/usr/local/apache/conf/hosts.redirect #RewriteCond ${hosts-redirect:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND RewriteCond %{REMOTE_ADDR} ^192\.168\.168\.[2-254]$ RewriteRule ^/.* http://www.example.com/ [R,L] What I am trying to do is take IP's in a class C (in this case 192.168.168.0/24) 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: 192.168.168.2 - 192.168.168.3 - 192.168.168.4 - etc etc That does work just fine. The second RewriteCond does not work. Here is a snipet from my rewrite_log: 192.168.168.2 - - [23/Jun/2004:21:21:25 +0000] [10.10.10.10/sid#80b6034][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 something. Help list! Thanks for your time. Jeff --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org