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 ...
Kevin_Stewart
Aug 30, 2012Employee
Something like this should work:
when HTTP_REQUEST {
HTTP::uri [string map {".asp?" ".aspx?"} [HTTP::uri]]
}
This will silently replace the .asp? with .aspx? in the server-flowing URI. The client won't see this.
Or if you actually want to generate a redirect:
if { [HTTP::uri] contains ".asp?" } {
set uri [string map {".asp?" ".aspx?"} [HTTP::uri]]
HTTP::redirect "https://[HTTP::host]$uri"
}
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