Forum Discussion
muzammil_88686
Nimbostratus
Sep 28, 2012Redirection of URLs
I m trying to redirect the below URLs.
1)
From: http://www.mysite.com/abc/def/ghi/jkl/fiber/?lang=en&resetP=true
To: http://www.mysite.com/abc/def/ghi/jkl/broad/?lang=en&re...
Michael_Yates
Nimbostratus
Oct 01, 2012Hi muzammil,
Try this. Should be easy to make adjustments to if needed.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"www.mysite.com" -
"mysite.com" -
"10.1.1.1" {
switch -glob [string tolower [HTTP::path]] {
"/123" -
"*/abc/def/123" {
HTTP::redirect "http://www.mysite.com/abc/def/personal/123/?resetP=true"
}
"*/fiber/" {
HTTP::redirect "http://[HTTP::host][string map {"/fiber" "/broad"} [HTTP::uri]]"
}
"*/fiber/!ut" {
HTTP::redirect "http://[HTTP::host][string map {"/fiber/!ut" "/broad"} [HTTP::uri]]"
}
}
}
}
}
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