Negative matchs on REMOTE_ADDR not working

Topics: Developer Forum, Project Management Forum, User Forum
Jul 14, 2011 at 1:31 AM

Is it happening for anyone else that negative matches on REMOTE_ADDR are not working?

In mod_rewrite for apache you can create a rule like

RewriteCond %{REMOTE_ADDR} !^173\.223\.\d{1,3}\.\d{1,3}$

RewriteRule ^/(.*) http://mysite/location/ [I,R=301]

and it will redirect to http://mysite/location/ for all IPs except those in the 173.223.*.* range.  This doesnt work (at least for me) in the Ionics Isapi Rewrite Filter.

I can turn this around by taking out the exclamation point so it redirects to that site for only IPs in the 173.223.*.* range (and this works as expected).

Is this a bug?

Coordinator
Jul 17, 2011 at 6:02 PM

What version of IIRF are you using?

Can you show me the IIRF log for the startup of your server?   I would expect the ! to work as a negation.