cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Request Redirect

Ts67p18
Nimbostratus
Nimbostratus

i need to redirect the following: 

https://abc.org/prod/items/ebb81b9e-0e6f-4bd8-af22-bf865212e2cd/1/

to

 https://cde.edu/ware/lesson/ebb81b9e-0e6f-4bd8-af22-bf865212e2cd/1/

there will be many requests containing different content after "/items/" that will need to be redirected to the new site and i am hoping to do this with one iRule.

is there a way to strip out the "ebb81b9e-0e6f-4bd8-af22-bf865212e2cd/1/" and add it to the new URL?

 

3 REPLIES 3

Hi Ts67p18,

when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/prod/items/" } { HTTP::redirect "https://cde.edu/ware/lesson[string map -nocase {/prod/items/ /} [HTTP::uri]]" return } }

 

Ts67p18
Nimbostratus
Nimbostratus

thank you i will give this a try

Ts67p18
Nimbostratus
Nimbostratus

thanks so much, worked the first time