18-Jun-2020 00:05
Hi,
I am not really familiar with iRule, can somebody help me?
So the scenario is that a user wants to access a f5 vip which will be redirected to a certain site:
user access onboarding.abc.com/uk (f5 vip) and it should redirect to https://ask.service.com/management.do
how can i attain this? it's needs to be exactly as onboarding.abc.com/uk
Thanks!
18-Jun-2020
01:38
- last edited on
24-Mar-2022
01:16
by
li-migration
Hello ,
You can even achieve your requirement using LTM Policy option. Also you can try below iRule.
when HTTP_REQUEST {
if { [HTTP::host] contains "onboarding.abc.com"}{
if { [HTTP::uri] starts_with "/uk"}{
HTTP::redirect https://ask.service.com/management.do
}
}
}
Hope it works!
Mayur
18-Jun-2020
04:46
- last edited on
24-Mar-2022
01:16
by
li-migration
Policy is always a better choice. I agree with 's iRule. Small correction needed; There is no points to add multiple if condition. Find the below iRule, Hope it will work for you.
when HTTP_REQUEST {
if { ([HTTP::host] equals "onboarding.abc.com") && ([HTTP::uri] starts_with "/uk") } {
HTTP::respond 301 Location "https://ask.service.com/management.do"
}
}
18-Jun-2020 20:23
HTTP::redirect:- This command always sends an HTTP 302 (Temporary Redirect) status code. HTTP request to the specified URL, or replaces the current response with a redirect to the specified URL.
HTTP::respond:- This command sends a response to the client telling the client to send a fresh request to the URL you specify. A 301 redirect means that the page has permanently moved to a new location.