14-Aug-2023 01:41
Hi,
Please share below irule syntax for below URL redirection.
https://excample.com:9085/ldmcatalog/* to https://excample.com/ldmcatalog/*
Solved! Go to Solution.
14-Aug-2023 15:46
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...
14-Aug-2023 05:21
@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]"
}
}
14-Aug-2023 15:46
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...
21-Aug-2023 15:39
@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