Olivier_Minet_6
Jan 28, 2014Nimbostratus
Replace subdomain and remove path
Greetings,
I'm struggling with this :
I would like this : http://www.mysite.org/customfiles/mydoc.htm transformed into this: http://customfiles.mysite.org/mydoc.htm
Of course, there are several files, mydoc.htm is just an example. And the original site www.mysite.org must not be affected.
Note : This URL will be forwarded to a pool so I cannot use redirect.
I've written the following iRule:
when HTTP_REQUEST {
if { [HTTP::path] starts_with "/customfiles"} {
HTTP::path [string replace [HTTP::path] 0 12 ""]
HTTP::header replace Host "customfiles.onprvp.fgov.be"
pool my_pool
}
}
And nothing happens. In the F5 logs we only have a warning message saying the rule already exists on partition Common, but nothing else.
I suspect that the string replace isn't very happy but a string map gives the same.
What am I doing wrong ? 🙂