Forum Discussion
Manuel_60430
Mar 31, 2014Nimbostratus
We are not using a custom http profile on this VS. Actually all our needs are customized with iRules. There are two iRules which triggers http redirects.
One for recdirecting a group of certain ("foreign") URIs (like facebook.domain.com to facebook.com/domain, e.g.)
when HTTP_REQUEST {
'root domain redirect'
if { [HTTP::host] == "mydomain.com" } then {
HTTP::respond 301 Location http://www.mydomain.com[HTTP::uri]
}
elseif { [class match [string tolower [HTTP::uri]] equals REDIRECTS_301_SCO ] } then {
HTTP::respond 301 Location [class lookup [string tolower [HTTP::uri]] REDIRECTS_301_SCO ]
}
}
and the other one is quite old and presents some hardlined redirects:
when HTTP_REQUEST {
if { [HTTP::request] == "http://asia.mydomain.com/taiwan" } {
HTTP::redirect http://www.mydomain.com/something
}
elseif { [HTTP::request] == "http://asia.mydomain.com/hongkong" } {
HTTP::redirect http://www.mydomain.com/something
}
elseif { [HTTP::request] == "http://asia.mydomain.com/china" } {
HTTP::redirect http://www.mydomain.com/something
}
elseif { [HTTP::host] contains "asia.mydomain.com" } {
HTTP::redirect http://www.mydomain.com
}
}
Furthermore we have cookie persistence and a fallback host enabled with an iRule.
Does this help anything?