Apache RewriteCond on REMOTE_ADDR ignored

This is a discussion on Apache RewriteCond on REMOTE_ADDR ignored within the Linux Web Servers forums, part of the Web Server and Related Forums category; With stronghold/4.0c, (Apache/1.3.22), a simple RewriteCond on REMOTE_ADDR appears to be ignored i.e. the ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-08-2005
george
 
Posts: n/a
Default Apache RewriteCond on REMOTE_ADDR ignored

With stronghold/4.0c, (Apache/1.3.22), a simple RewriteCond on
REMOTE_ADDR appears to be ignored i.e. the rules are applied even if
the condition is not met.

The relevant directives (in a VirtualHost section) are:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^172\.16\.248\.57$
RewriteRule ^/click/(.*) /portal_test/click/$1
RewriteRule ^/etrack/(.*) /portal_test/etrack/$1
RewriteRule ^/item/(.*) /portal_test/item/$1
RewriteRule ^/map/(.*) /portal_test/map/$1
RewriteRule ^/market_apply/(.*) /portal_test/market_apply/$1
RewriteRule ^/shopping/(.*) /portal_test/shopping/$1

The goal is to rewrite requests for the specified resources which are
received from one particular IP Address (172.16.248.57) to test
versions in another directory.

The problem is not with the rewrites, they work fine. Unfortunately
they work fine for ALL IP addresses and not just 172.16.248.57.

Any suggestions as to what I've done wrong or what else to check?

Many thanks in advance for any assistance,

George

  #2 (permalink)  
Old 12-08-2005
Andreas Prilop
 
Posts: n/a
Default Re: Apache RewriteCond on REMOTE_ADDR ignored

On 8 Dec 2005, george wrote:

> RewriteEngine On
> RewriteCond %{REMOTE_ADDR} ^172\.16\.248\.57$
> RewriteRule ^/click/(.*) /portal_test/click/$1
> RewriteRule ^/etrack/(.*) /portal_test/etrack/$1
>
> The problem is not with the rewrites, they work fine. Unfortunately
> they work fine for ALL IP addresses and not just 172.16.248.57.


The RewriteCond is only valid for the first RewriteRule.

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lang>

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:07 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0