Irule-URL redirection

Hi,

Please help on writing irule for URL redirection. The ask is below

Incoming traffic to f5 – https://test.yourdistributor.com/{anything/everythig}

F5 needs to redirect to - https://test1apigw01p.test.com:9022/{anything/everythig}

Kindly suggest irule on this.

Hello Irshad,

Please try below iRule -

when HTTP_REQUEST {

if { [HTTP::host] equals “test.yourdistributor.com” and [HTTP::uri] equals “/” } {

HTTP::redirect " https://test1apigw01p.test.com:9022/"

}

}

Hope it works for your!

Mayur

Thanks Mayur, Let me test this.

If not above, try below iRule. This will redirect to the given domain without making any changes in uri part.

when HTTP_REQUEST {

if { [HTTP::host] equals “test.yourdistributor.com”} {

HTTP::redirect “https://test1apigw01p.test.com:9022[HTTP::uri]”

}

}

is it worked for you ?

Mayur

No it is not, Looks to be some issue at server end. will update on this