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...
Kevin_Stewart
Employee
Apr 21, 2014Small typo I think, but here's another version:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"*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]"
} elseif { [HTTP::query] contains "FID=" } {
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=topics&f=[URI::query [HTTP::uri] FID]"
} elseif { [HTTP::query] contains "C=" } {
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=forum&c=[URI::query [HTTP::uri] C]"
}
return
}
"*newdomain.com" -
"*olddomain.com" {
This needs to catch newdomain.com/uri or olddomain.com/uri and redirect
if { [string tolower [HTTP::uri]] contains "secure" } {
HTTP::redirect "http://newdomain.com/Issues/2014/04/some-page.aspx"
} elseif { [string tolower [HTTP::uri]] contains "secure2" } {
HTTP::redirect "http://newdomain.com/Issues/2014/04/some-other-page.aspx"
}
}
}
}
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