I have the following iRules (work fine)
when HTTP_REQUEST {
if {[HTTP::host] equals {siteA.com}}{
HTTP::redirect “https://www.siteB.com/promo/biz_tv_…_id=350042”
}
if {[HTTP::host] equals {www.siteA.com}}{
HTTP::redirect “”
}
}
I need to add the following redirect but can’t seem to get it to work
if {[HTTP::host] contains {siteA.com/whole}}{
HTTP::header “https://www.siteB.com/promotions/biz\_tv\_0330/735\_729.jsp?WT.mc\_id=171074” }
It always defaults to the first line. The problem is I need both IDs so I can’t drop the first redirect .
Any help is appreciated.
Dave
I am guessing the “HTTP::header” is a typo and you meant “HTTP::redirect”. I will go on that assumption.
You could try something like this:
when HTTP_REQUEST {
if { [HTTP::host] equals "siteA.com" } {
switch [HTTP::path] {
"/whole" { HTTP::redirect "https://www.siteB.com/promotions/biz_tv_0330/735_729.jsp?WT.mc_id=171074" }
default { HTTP::redirect "https://www.siteB.com/promo/biz_tv_..._id=350042" }
}
}
if { {[HTTP::host] equals {www.siteA.com}}{
HTTP::redirect "https://www.siteBcom/promotions/biz...xid=350042"
}
}
You could use a switch in place of the 2 “if” statements too but I think this will accomplish what you want.
Richard
Richard,
Thank you. It works great and is very much appreciated.
Dave