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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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> |