Forum Discussion
DM_5174
May 19, 2011Nimbostratus
Multiple URI matching redirect
Hi All,
I was trying to accoplish the following things using a class or "string tolower" one-on-one matching to redirect the URI.
Can anyone please help or could suggest the best way to accompl...
DM_5174
May 20, 2011Nimbostratus
Hi Aaron,
I have tried the below code and could not get it to work. Is there anything wrong I am doing?
when HTTP_REQUEST {
if { [HTTP::host] equals "www.mysite.com" } {
log local0. "User went to http://[HTTP::host][HTTP::uri]"
set site [HTTP::uri]
switch -glob [string tolower [HTTP::uri]] {
"/old-service/old-app1*" {
HTTP::redirect "https://[HTTP::host]/new-service/new-app100"
}
"/old-service/old-app2*" {
HTTP::redirect "https://[HTTP::host]/new-service/new-app200"
}
"/old-service/old-app3*" {
HTTP::redirect "https://[HTTP::host]/new-service/new-app300"
}
"/old-service/old-app4*" {
HTTP::redirect "https://[HTTP::host]/new-service/new-app400"
}
"/old-service/old-app5*" {
HTTP::redirect "https://[HTTP::host]/new-service/new-app500"
}
}
}
Thanks,
-DM
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