Forum Discussion

mikey_webb's avatar
Mar 29, 2021

irule to redirect uri - help


i have a redirect based on country which works if in uk redirects to

I need to redirect but also to retain a catalogue number so for example redirects to

For this the below works well

   elseif { [HTTP::host] ends_with "" and [HTTP::uri] starts_with "/book/catalogue" } {

      HTTP::redirect "[HTTP::uri]" 


however i now need to redirect redirects to


can anyone help, give pointers how to do

1 Reply

  • Hello Mikey.

    Just try with this

    set new_uri [string map {"/book/catalogue/" "/catalogue/book/"} [HTTP::uri]]
    HTTP::redirect "$new_uri"