29-Mar-2021 05:11
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
29-Mar-2021
06:51
- last edited on
04-Jun-2023
20:59
by
JimmyPackets
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.