Forum Discussion
Neil_66348
Nimbostratus
Aug 15, 2013HTTP Cookie Redirect based upon cookie value and URL
Hi Guys,
Have an internal APP with needs language support now...
Basically , redirect to a different URL based upon a language cookie set on the web server and the URL asked for .
The below is ba...
Neil_66348
Nimbostratus
Aug 15, 2013Hi Nathan ,
Thanks for the reply.
The HTTP cookie part works perfectly , the redirection works. However it appears to fail as the rule applies to any URI , eg www.website.com/test/page it will redirect to "www.website.com/page.apsx?lang=en" , so you can't browse to any page deeper....
I tried the HTTP:HOST equals - but that doesn't appear to work. The request should only fire when for the root page....
when HTTP_REQUEST {
if { [HTTP::cookie exists "LANG"] } {
switch [HTTP::host] equals {
"www.website.com" -
"website.com" {
switch [HTTP::cookie value "LANG"] {
EN { HTTP::redirect "www.website.com/page.apsx?lang=en" }
ES { HTTP::redirect "www.website.com/page.apsx?lang=ES" }
DE { HTTP::redirect "www.website.com/page.apsx?lang=DE" }
}
}
}
}
}
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
