Forum Discussion
jmartinez_44554
Nimbostratus
Feb 07, 2014Redirects with multiple params
I'm trying to redirect the following uri and not having any success. I want to keep the second param and remove the first one.
http://domain.com/techsupport/nontemplates/Download%20Center/Downlo...
nitass
Employee
Feb 07, 2014the switch's string is set to lowercase but pattern is not.
e.g.
[root@ve11a:Active:In Sync] config tmsh list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/techsupport/nontemplates/Download%20Center/DownloadCenter.aspx?Download_content=User+Manuals&download_product*" {
set newURI [string map -nocase {"/techsupport/nontemplates/Download%20Center/DownloadCenter.aspx?Download_content=User+Manuals&download_product=" "/Redirect/Content/User+Manuals/Product/"} [HTTP::uri]]
HTTP::redirect "http://[HTTP::host]$newURI"
}
}
}
}
[root@ve11a:Active:In Sync] config curl -I "http://172.28.24.10/techsupport/nontemplates/Download%20Center/DownloadCenter.aspx?Download_content=User+Manuals&download_product=A660DF1A-91FF-445B-8125-CE49DF253C64"
HTTP/1.0 302 Found
Location: http://172.28.24.10/Redirect/Content/User+Manuals/Product/A660DF1A-91FF-445B-8125-CE49DF253C64
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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