Forum Discussion
Dayton_Gray_103
Nimbostratus
Sep 20, 2007Change URI parameters with a 301 redirect
I am looking to change a URI to remove certain query string parameters and redirect with a 301.
Example:
Incoming URI
www.example.com/example.jsp?zoneId=624906&zz=2255956&parentPage=exa...
Dayton_Gray_103
Nimbostratus
Sep 27, 2007The final iRule that seems to be working well is:
when HTTP_REQUEST {
if { [HTTP::query] contains "&" } {
if { [HTTP::path] contains "/zone/" } {
set zoneid [findstr [HTTP::uri] "zoneId=" 0 "&"]
if { [string length $zoneid] > 0 } {
HTTP::respond 301 Location "http://[HTTP::host][HTTP::path]?$zoneid"
}
}
}
else {
pool misc_pool
}
}
Thank you both very much for all of the help!!!
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