cancel
Showing results for 
Search instead for 
Did you mean: 

iRule creation based on URI

MikeyG
Nimbostratus
Nimbostratus

Disclaimer, I know little to nothing about creating iRules, hence why I am here.

I need to create the following iRule.

create an irule that will inspect the URI of the incoming request and make a "routing" decision. 

 

https://abc.mike.com/abc1 proxy to https://help.mike.com/abc1

https://abc.mike.com/abc2 proxy to https://help2.mike.com/abc2

any other URI proxy to https://abc2.mike.com

 

Thanks for any help

 

Mike

1 ACCEPTED SOLUTION

Hi Mike,

when HTTP_REQUEST { if { [HTTP::host] equals "abc.mike.com" } { switch [HTTP::uri] { "/abc1" { HTTP::redirect https://help.mike.com/abc1 } "/abc2" { HTTP::redirect https://help2.mike.com/abc2 } default { HTTP::redirect https://abc2.mike.com } } } }

 

View solution in original post

2 REPLIES 2

Hi Mike,

when HTTP_REQUEST { if { [HTTP::host] equals "abc.mike.com" } { switch [HTTP::uri] { "/abc1" { HTTP::redirect https://help.mike.com/abc1 } "/abc2" { HTTP::redirect https://help2.mike.com/abc2 } default { HTTP::redirect https://abc2.mike.com } } } }

 

You make it look simple, that would have been 3wweks and a bottle of Tums for me, thank you.