Forum Discussion
Traffic policy for url redirection creating Loops
Hello All, I am trying to do the url redirect as below and i have created a Traffic policy(https://support.f5.com/kb/en-us/solutions/public/14000/900/sol14996.html) for the same.URL is redirecting but it is looping. Could you please help me to diagnose the issue?
something.com -> google.com (1.1.1.1) We now need rules on the F5 Load Balancer to redirect as follows: http://something.com -> https://google.com/web/sei https://something.com -> https://google.com/web/sei http://something.com/* -> https://google.com/*
5 Replies
- Amit585731
Nimbostratus
URl is looping? Can you please explain? In some cases I have seen the issue at server side, so you can use below irule:
when HTTP_REQUEST { if{[HTTP::host] equals "something.com"} HTTP::redirect "https://google.com[HTTP::uri]" } else { return } }
- Vijay_E
Cirrus
HTTPS traffic: https://something.com -> https://google.com/web/sei
when HTTP_REQUEST { if { ([HTTP::host] eq "something.com") and ([HTTP::uri] eq "/") } { HTTP::respond 301 Location "https://google.com/web/sei" } }You are probably not matching on "/" in the [HTTP::uri]. This is for HTTP traffic:
when HTTP_REQUEST { if { ([HTTP::host] eq "something.com") } { if { [HTTP::uri] eq "/" } { HTTP::respond 301 Location "https://google.com/web/sei" } else { HTTP::respond 301 Location "https://google.com[HTTP::uri]" } } } - Nyam_220167
Nimbostratus
Hello Odaah, Tq for your quick reply. out of the 3 rules 2 of them are working.
But below rule is not working. Can you please help me to fix this?
1a. http://www.something.com -> https://www.google.com/web/something - not working yet 1b. https://www.something.com -> https://www.google.com/web/something - not working yet
- Vijay_E
Cirrus
Can you provide the iRule that you are using and that is not working at the moment ?
- Nyam_220167
Nimbostratus
when HTTP_REQUEST { if { ([HTTP::host] contains "something") } { if { [HTTP::uri] contains "/*" } { HTTP::respond 301 Location "https://www.google.com/web/xxx" } else { HTTP::respond 301 Location "https://www.google.com[HTTP::uri]" } } }
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