This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: RewriteCond with mod_replace
Author
Message |
techchif2
Newbie


Joined: 09 March 2008
Posts: 23
Posted: 09 August 2010 at 4:11am

Hi how can I enable filter of mod_replace only for specific IP?
I tried to use RewriteCond but w/o any successes
My filter:

ReplaceFilterDefine filter1 CaseIgnore intype=text/html
ReplacePattern filter1 "(=\W)([/\-_\d\w]+)\.(css|gif|jpg|png|js|swf)" "$1http://statics.site2.com$2.$3"
RewriteCond %{REMOTE_ADDR} ^127.0.0.1$
SetEnv mod_replace filter1




Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 09 August 2010 at 4:26am

Hello,
RewriteCond is a directive of mod_rewrite. You can use it in pair with RewriteRule/RewriteProxy directives only.
mod_setenvif has very advanced conditions syntax. Please try this code:

Code:
ReplaceFilterDefine filter1 CaseIgnore intype=text/html
ReplacePattern filter1 "(=\W)([/\-_\d\w]+)\.(css|gif|jpg|png|js|swf)" "$1http://statics.site2.com$2.$3"
SetEnvIf %{REMOTE_ADDR} ^127.0.0.1$ mod_replace=filter1


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
techchif2
Newbie


Joined: 09 March 2008
Posts: 23
Posted: 09 August 2010 at 4:41am

thanks

Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version