Forum Discussion
Joe_Pipitone
Nimbostratus
Apr 07, 2014Various rewrites/redirects on one VIP
I am currently burning up 3 VIPs to get all these redirects and rewrites working, however I'd like to efficiently combine the iRule, and point all 3 domains to the same VIP and accomplish the same th...
Joe_Pipitone
Nimbostratus
Apr 21, 2014Still having trouble getting this rule to work. The first part works, where it redirects the old forum topics and threads, however it doesn't seem to work its way down and catch newdomain.com or olddomain.com. I setup logging, which is one of the reasons why I know its not getting past the first batch of if statements.
domain1, domain2, and forum rewrites
when HTTP_REQUEST {
if {[HTTP::host] ends_with "oldforum.olddomain.com"} {
This needs to catch oldforum.olddomain.com and rewrite to newforum.newdomain.com
if { [HTTP::query] contains "TID=" } {
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=posts&t=[URI::query [HTTP::uri] TID]"
return
}
if { [HTTP::query] contains "FID=" } {
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=topics&f=[URI::query [HTTP::uri] FID]"
return
}
if { [HTTP::query] contains "C=" } {
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=forum&c=[URI::query [HTTP::uri] C]"
return
}
elseif { ([HTTP::host] ends_with "newdomain.com") or ([HTTP::host] ends_with "olddomain.com") } {
This needs to catch newdomain.com/uri or olddomain.com/uri and redirect
log local0. "Hostname is [HTTP::host]" }
if { [string tolower [HTTP::uri]] contains "secure" } {
HTTP::redirect "http://newdomain.com/Issues/2014/04/some-page.aspx"
return
}
else {
if { [string tolower [HTTP::uri]] contains "secure2" } {
HTTP::redirect "http://newdomain.com/Issues/2014/04/some-other-page.aspx"
return
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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