Forum Discussion
Manuel_60430
Nimbostratus
Mar 25, 2014TCL error message with X-Forwarded-For iRule
We are using the X-Forwarded-For http header field on the BigIP LTM to server our webshop application with client IP addresses (to determinde country hawk and so on). Our web application can only wor...
Manuel_60430
Nimbostratus
Mar 31, 2014We 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?
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