Forum Discussion
Brian_Kenworthy
Aug 30, 2012Nimbostratus
Redirect to New Page but Pass Query String Parameters
Hi All,
Need some advice on what an iRule would look like to do this....We are moving from legacy ASP listeners to .net listeners, but we don't want the client to change their endpoint ...
Brian_Kenworthy
Sep 11, 2012Nimbostratus
Actually, I have another wrinkle to add...here's the code we're using and what is happening. Also note I had to replace the " " with {} per a configsync issue (http://support.f5.com/kb/en-us/solutions/public/12000/700/sol12795.html)
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/client/order.asp*" -
"/vendorABC/status.asp*" -
"/vendorXYZ/status.asp*" {
log local0. "Rewriting [HTTP::uri] to [string map -nocase {{VendorABC} {Listeners} {status.asp?} {abcstatus.ashx?}} [HTTP::uri]]"
HTTP::uri [string map -nocase {{VendorABC} {Listeners} {status.asp?} {abcstatus.ashx?}} [HTTP::uri]]
log local0. "Rewriting [HTTP::uri] to [string map -nocase {{VendorXYZ} {Listeners} {status.asp?} {xyzstatus.ashx?}} [HTTP::uri]]"
HTTP::uri [string map -nocase {{VendorXYZ} {Listeners} {status.asp?} {xyzstatus.ashx?}} [HTTP::uri]]
pool beta.res-direct.com_B2B_HTTP
}
So when a post hits /VendorABC/status.asp?... it gets routed correctly to /Listeners/abcstatus.ashx?...
But
The next post to /VendorXYZ/status.asp?... it gets an error becuase it's hitting /Listeners/abcstatus.ashx?... instead of /Listeners/xyzstatus.ashx?....
Because the asp page is named the same in both URIs, the first rule is detecting it and sending it to the wrong location. Is there a way to say when both /VendorABC/status.asp? are in the URI, direct to /Listeners/abcstatus.ashx? and when /VendorXYZ/status.asp? are in the URI, direct to /Listeners/xyzstatus.ashx?
I'm pulling my hair out with this one....Thanks in advance!
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