Anis_Bhambhani
May 21, 2020Nimbostratus
iRule to redirect to new url, but retain path in URI
I have been tasked with creating an irule to redirect a url but keep everything else in URI
Tried with the below but had no luck.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "wwwabc.com" and [string tolower [HTTP::uri]] starts_with "/TEST/" } {
HTTP::respond 301 noserver Location "<https://wwwxyz.com/[string map {/TEST/ /} [string tolower [HTTP::uri]]]>"
}
}
It should look like
Redirect From -
https://wwwabc.com/Test/getQuote.htm?campaignCode=LIDL&campaignSource=LIDL&isMyLife=true
To -
https://wwwxyz.com/Test/getQuote.htm?campaignCode=LIDL&campaignSource=LIDL&isMyLife=true
- Any Suggestions please?