Forum Discussion
JohnnyBacchus
Aug 05, 2021Nimbostratus
iRule Redirection Help
Hello, I have a peculiar situation that I'm trying to figure out if iRules can pull off for me but I'm not sure about the approach here. For context, we have one DNS entry pointing directly to ...
Mayur_Sutare
MVP
Hi ,
You can try below iRule -
when HTTP_REQUEST {
if { [HTTP::host] equals "example1.com" }{
if { [HTTP::uri] contains "something" }{
HTTP::redirect "https://example2.com"
}
}
}
Also below is the irule which will also help to redirect to the uri along with the host. So you shouldn't require separate irule to redirect to the uri if you want to keep same uri path.
when HTTP_REQUEST {
if { [HTTP::host] equals "example1.com" }{
if { [HTTP::uri] contains "something" }{
HTTP::redirect "https://example2.com[HTTP::uri]"
}
}
}
Also if your F5s are running on 14.1.0 or later version, kindly consider - https://support.f5.com/csp/article/K23237429
Hope it helps!
JohnnyBacchus
Aug 12, 2021Nimbostratus
Okay, I tried both of those iRule options and neither worked. We still receive an error message of 'ERR_CONNECTION_RESET'.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects