Forum Discussion
ecwlam
Altostratus
3 years agoiRule redirection
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...
- 3 years ago
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]"
}
}
muhamed_elfiky
Altocumulus
3 years agoHi ecwlam
you can use this IRule :
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/aa"}{
HTTP::redirect https://[HTTP::host]/bb
}
}
ecwlam
Altostratus
3 years agoThanks 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