Forum Discussion
Joe_Pipitone
Apr 21, 2014Nimbostratus
Still 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
}
}
}
}