jmartinez_44554
Feb 07, 2014Nimbostratus
Redirects 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/DownloadCenter.aspx?Download_content=User+Manuals&download_product=A660DF1A-91FF-445B-8125-CE49DF253C64
This the code I'm using. Other redirects are working fine but they have no params or only one.
when HTTP_REQUEST { set myUri [HTTP::uri] set myHost [HTTP::host] switch -glob [string tolower [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]] log local0. "redirecting to http://[HTTP::host]$newURI" HTTP::redirect "http://[HTTP::host]$newURI } }