Forum Discussion
pkhatri_72515
Nimbostratus
Jan 15, 2010need 301 redirect help please.
301 redirect of following. Can you please help me out on a best way to do this in F5? iRule? version 9.3.
http://www.bla.com/home/index.cfm?&LANG=EN&CountryLanguage=EN_GL -------> http:...
The_Bhattman
Nimbostratus
Jan 15, 2010Here is a another way to do this. It hasn't been tested but it's a bit more refined.
when HTTP_REQUEST {
switch -glob [string tolower [uri::query [HTTP::uri] CountryLanguage]] {
"en_gl" {
HTTP::respond 301 Location "[HTTP::host]/gl"
}
"en_ap" {
HTTP::respond 301 Location "[HTTP::host]/ap"
}
"fr" {
HTTP::respond 301 Location "[HTTP::host]/fr"
}
"de" {
HTTP::respond 301 Location "[HTTP::host]/de"
}
"en_ir" {
HTTP::respond 301 Location "[HTTP::host]/ie"
}
"it" {
HTTP::respond 301 Location "[HTTP::host]/it"
}
"nl" {
HTTP::respond 301 Location "[HTTP::host]/nl"
}
"pr" {
HTTP::respond 301 Location "[HTTP::host]/pr"
}
"sp" {
HTTP::respond 301 Location "[HTTP::host]/es"
}
"sw" {
HTTP::respond 301 Location "[HTTP::host]/se"
}
"en_uk" {
HTTP::respond 301 Location "[HTTP::host]/uk"
}
Default {
HTTP::respond 301 Location "[HTTP::host]/nosite.html"
}
}
}
I hope this helps
Bhattman
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