Forum Discussion
Danny_Trinh_197
Nimbostratus
Jan 11, 2009Redirect test.example.com to test.example.com/abc/def/gh...i
I searched this forum but couldn't find the answer, and I'm kind new to F5.
What can I do to redirect:
this url: http://test.example.com
to:
http://test.example.com/abc/def/ghi/jkl/mno/
I found this below, but I got an error of looping:
when HTTP_REQUEST {
if { [HTTP::host] equals "webclient.example.com" } {
HTTP::redirect "http://webclient.example.com/abc/def/ghi/jkl/mno/"
}
}
Thanks,
- hoolio
Cirrostratus
You can add a check of the URI so you're only redirecting clients who make a request to the root (/):when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "webclient.example.com" && [HTTP::path] eq "/" } { HTTP::redirect "http://webclient.example.com/abc/def/ghi/jkl/mno/" } }
- Danny_Trinh_104
Nimbostratus
It's work great. Thanks, - hoolio
Cirrostratus
The host header value doesn't include the protocol, so this iRule would work for HTTP or HTTPS. If you have an HTTP VIP and an HTTPS VIP, you can use this iRule on both VIPs.
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