Forum Discussion
URL redirection irule
- Aug 14, 2023
This solution Paulius shares here is 💯 as is, but for those looking for the slightest optimizations, you could swap out the HTTP::uri in the conditional and swap in HTTP::path, which will be a shorter comparison if there are any query parameters on the requests. Very minimal benefits, but if you obsess over every CPU cycle...
Preet_pk The following iRule should do what I believe you are describing above.
when HTTP_REQUEST priority 500 {
if {([HTTP::host] == "example.com:9085") && ([string tolower [HTTP::uri]] starts_with "/ldmcatalog/") } {
HTTP::redirect "https://example.com[HTTP::uri]"
}
}
- JRahmAug 14, 2023Admin
This solution Paulius shares here is 💯 as is, but for those looking for the slightest optimizations, you could swap out the HTTP::uri in the conditional and swap in HTTP::path, which will be a shorter comparison if there are any query parameters on the requests. Very minimal benefits, but if you obsess over every CPU cycle...
Recent Discussions
Related Content
* 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