Forum Discussion
cxcal_18687
Jan 26, 2011Nimbostratus
HTTP and URI Redirect
Can someone assist with a iRules with the following requirements:
1) When a client hits "" they should be redirected to "https:///Proxy"
2) If clients hits they should be redire...
Colin_Walker_12
Jan 26, 2011Historic F5 Account
Okay, so you just want a redirect that works for either HTTP or HTTPS?
So you create a virtual for each (or one that listens on both) with an irule like:
when HTTP_REQUEST {
if {([HTTP::host] eq "medtest.com") and ([HTTP::uri] eq "/")} {
HTTP::redirect "https://10.10.10.1/Proxy"
}
}
You can ignore whether they're coming in on http or https if you want to redirect both to the same place anyway. Then you'd just set up a vip for 10.10.10.1 that points to the VLProxy pool.
Alternatively you could get tricky and just do host name re-writing and pool routing in one iRule, but the redirect route is simpler and would actually change the host for the user, which might be preferable.
Colin
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