Forum Discussion
Help iRule Redirection to the same VIP
I have an URL abc.xxx.com that i wanted to redirect to abc.xxx.com/site/ when the user type the URL. I tried with the following URL. it just adds /infosell// many times and doesn't work.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.joe.com"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]/infosell/"
}
}
With the simple redirect rule below, i get redirect loop in the browser. I am a newbie to iRules
when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host]/infosell/"
}
Can anyone help?
Thank you for help
2 Replies
- Minn_62043
Cirrostratus
You can write something like this:when HTTP_REQUEST { if { not ([HTTP::uri] starts_with "/infosell/") } { HTTP::redirect https://[HTTP::host]/infosell/ } } - Colin_Walker_12Historic F5 AccountI think what you're looking for is something like:
when HTTP_REQUEST { if { ([HTTP::host] eq "www.joe.com") && !([HTTP::uri] starts_with "/infosell") } { HTTP::redirect "https://[HTTP::host]/infosell" } }
That would redirect any request to joe.com that isn't going to joe.com/infosell to that directory. If you need something else, let me know.
Colin
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