Forum Discussion
Dave_Wagner
Jan 13, 2012Nimbostratus
Need help with iRule redirect
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"
}
...
richard_77048
Jan 13, 2012Nimbostratus
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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects