cancel
Showing results for 
Search instead for 
Did you mean: 

redirect some valid pages but set to reset or main page site with other garbage.

Hien_Truong
Cirrus
Cirrus

Hi,

i need help with redirect irule:

 

if user type the valid uri:

https://mysite.com/work/validpage1 redirect to https://othersite.com/pages

https://mysite.com/work/validpage2 redirect to https://othersite.com/pages

 

but if user type any gargage sites or misspell sites (not valid sites):

https://mysite.com/work/garbage1 redirect to https://mysite.com

https://mysite.com/work/abcdefg1 redirect to https://mysite.com

https://mysite.com/work/valiydpage1 redirect to https://mysite.com

 

i appreciate your help.

Thanks

2 REPLIES 2

Hi Hien Truong,

when HTTP_REQUEST { set host [HTTP::host] set uri [string tolower [HTTP::uri]] }   when HTTP_RESPONSE { if { $host eq "mysite.com" && $uri starts_with "/work/" } { if { [HTTP::status] eq "200" } { HTTP::redirect "https://othersite.com/pages" } else { HTTP::redirect "https://mysite.com" } } }

 

Hien_Truong
Cirrus
Cirrus

​thanks for your reply.