Forum Discussion
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.
5 Replies
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
- irshad
Nimbostratus
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
- irshad
Nimbostratus
No it is not, Looks to be some issue at server end. will update on this
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
