Forum Discussion
URL redirection irule
Hi,
Please share below irule syntax for below URL redirection.
https://excample.com:9085/ldmcatalog/* to https://excample.com/ldmcatalog/*
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]" } }
- JRahmAdmin
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 - If your post was solved it would be helpful to the community to select *Accept As Solution*.
This helps future readers find answers more quickly and confirms the efforts of those who helped.
Thanks for being part of our community.
Lief
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