Forum Discussion
Oct 12, 2014
Hi mate!
I'm not following what you need actually, but let me brush up your syntax a bit so it's easier for us to understand your rule (I added a check for redirects so the iRule does not add location into every request):
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains ("/console-selfservice/") } {
HTTP::header replace "Host" site:7004
}
if { [string tolower [HTTP::uri]] contains ("/console-selfservice/TroubleShooting/") } {
HTTP::header replace "Host" site:7004
}
if { [string tolower [HTTP::uri]] contains ("/IMS-AA-IDP/sso/") } {
HTTP::header replace "Host" site:7004
}
}
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
HTTP::header replace Location [string map -nocase {site:7004 site:7004} [HTTP::header value Location]]
}
}
One other thing that you might want to consider is that if the second if is true, the first one is as well. Maybe that's not an issue for you, but maybe you want to do an if-else instead?
Could you please explain a bit more thorough what you want to happen with this irule, step by step?
/Patrik