Forum Discussion
irule to redirect uri - help
i have a redirect based on country which works www.abc.com if in uk redirects to uk.abc.com
I need to redirect but also to retain a catalogue number so for example www.abc.com/catalogue/book/3333 redirects to uk.abc.com/catalogue/book/3333
For this the below works well
elseif { [HTTP::host] ends_with "abc.com" and [HTTP::uri] starts_with "/book/catalogue" } {
HTTP::redirect "https://uk.abc.com[HTTP::uri]"
however i now need to redirect www.abc.com/book/catalogue/3333 redirects to uk.abc.com/catalogue/book/3333
can anyone help, give pointers how to do
- Dario_Garrido
Noctilucent
Hello Mikey.
Just try with this
set new_uri [string map {"/book/catalogue/" "/catalogue/book/"} [HTTP::uri]] HTTP::redirect "https://uk.abc.com$new_uri"
Regards,
Dario.
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