This forum has been moved here:
Helicon Tech Community Forum

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


Joined: 09 March 2008
Posts: 23
Posted: 12 July 2010 at 3:24am

1. Filter name must written in lowercase ?
when I used Upper case lettrer in filter name I got "Can't initialise and add filterStatics". I changed all to lowercase and it works.
2. How many filters I can use in one flow ?
3. Can I use mapping in ReplacePattern ?

used replace filter:
ReplaceFilterDefine filterstatics CaseIgnore intype=text/html
ReplacePattern filterstatics "(=\W)([/\-_\d\w]+)\.((css|js)|(gif|jpg|png|swf))" "$1http://(?4static:graphic).site.com$2.$3"
SetEnv mod_replace filterstatics

Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 12 July 2010 at 4:44am

Hello,
1) Lower case isn’t required. I believe it’s a little bug which will be fixed.

2) You may use as much filters as you want but all of them must have different name. The filters are applied in top-down order.

3) Please clarify what you mean by “mapping in ReplacePatter”. Thanks.

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


Joined: 09 March 2008
Posts: 23
Posted: 12 July 2010 at 11:07am

2) this sample return nothing
ReplaceFilterDefine filter1 CaseIgnore intype=text/html
ReplacePattern filter1 "(=\W)([/\-_\d\w]+)\.((css|js)|(gif|jpg|png|swf))" "$1http://(?4statics:graphics).site.com$2.$3"
SetEnv mod_replace filter1

ReplaceFilterDefine filter2 CaseIgnore intype=text/html
ReplacePattern filter2 "statics.site.com" "staticsRtest.site.com"
SetEnv mod_replace filter2

filter1 works but when I add filter2 both stopped work. does it replacing same stream synchrony or asynchrony ?

3) something like this
RewriteMap mapfile txt:C:/mapfile.txt
    key1 val1
    key2 val2
    key3 val3
   
ReplaceFilterDefine filter3 CaseIgnore
ReplacePattern filter3 "(key\d)" "$1=${mapfile:$1}"
SetEnv mod_replace filter3

should return:
key1=val1
key2=val2
key3=val3


Edited by techchif2 - 12 July 2010 at 11:31am
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 13 July 2010 at 5:05am

Hello,
I’m terribly sorry for confusing you. Actually you should use one name but may declare several patterns as follows:
Code:
ReplaceFilterDefine filter1 CaseIgnore intype=text/html
ReplacePattern filter1 "(=\W)([/\-_\d\w]+)\.((css|js)|(gif|jpg|png|swf))" "$1http://(?4statics:graphics).site.com$2.$3"
ReplacePattern filter1 "statics.site.com" "staticsRtest.site.com"
SetEnv mod_replace filter1


As regarding the maps, we’ve implemented that feature and it will be available in the coming build very soon.

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


Joined: 09 March 2008
Posts: 23
Posted: 15 July 2010 at 3:51am

when you planning to release mapping in ReplacePattern?
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 16 July 2010 at 8:55am

Hello,
We just released the build which supports that feature.
Thank you for your patience.

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


Joined: 09 March 2008
Posts: 23
Posted: 18 July 2010 at 2:08am

please provide working sample
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 19 July 2010 at 3:46am

Hello,
Please use this example:

Code:
RewriteMap mapfile txt:mapfile.txt [NC]

ReplaceFilterDefine simple_filter
ReplacePattern simple_filter "(aaaa)" "${mapfile:$1}"
ReplacePattern simple_filter "cccc" "dddd"

SetEnv mod_replace simple_filter


mapfile.txt has to be in a key-value format.

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

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

Printable version Printable version