22-Dec-2022 00:58 - edited 22-Dec-2022 01:32
May I know how to write the iRule with uri redirection?
https://www.abc.com/aa --> https://www.abc.com/bb
including the correspoing link under https://www.abc.com/aa
For example:
https://www.abc.com/aa/xxx/yyy/ --> https://www.abc.com/aa/xxx/yyy/
Solved! Go to Solution.
23-Dec-2022 01:34
Hi @ecwlam
you can use this IRule:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/aa/"} {
HTTP::uri [string map {"/aa/" "/bb/"}[HTTP::uri]]
HTTP::redirect "[HTTP::uri]"
}
}
22-Dec-2022 01:25
Hi @ecwlam
you can use this IRule :
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/aa"}{
HTTP::redirect https://[HTTP::host]/bb
}
}
22-Dec-2022 01:31
Thanks for your reply, it works with https://www.abc.com/aa --> https://www.abc.com/bb
However, the corresponding link does not work
it will redirect from https://www.abc.com/aa/xxx/yyy --> https://www.abc.com/bb
23-Dec-2022 01:34
Hi @ecwlam
you can use this IRule:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/aa/"} {
HTTP::uri [string map {"/aa/" "/bb/"}[HTTP::uri]]
HTTP::redirect "[HTTP::uri]"
}
}
27-Dec-2022 17:10
@ecwlam - I'm going to mark the reply from the 23rd as the Accepted Solution - if it didn't solve your problem, please let me know and I'll remove the designation.
27-Dec-2022 17:12
Thanks, it works well!
27-Dec-2022 17:43
21-Feb-2023 11:04
Hello All,
I am trying to a redirect with some complication. I need to redirect the URL to the backend server but keep the Friendly name in the browser.
Eg- appurl.com but the server is expecting appserverurl.com but the browser must always say appurl.com during request/response.
Hope this makes sense.
21-Feb-2023 09:13
Hello All,
I am trying to a redirect with some complication. I need to redirect the URL to the backend server but keep the Friendly name in the browser.
Eg- appurl.com but the server is expecting appserverurl.com but the browser must always say appurl.com during request/response.
Hope this makes sense.