Forum Discussion
Jericho_Gutierr
Nimbostratus
Apr 18, 2006http redirect to https for same V-server
Hi -
I'm looking for a simple, elegant solution for this. I have the following existing iRule for https redirect for one client:
when HTTP_REQUEST {
if { [HTTP::host] ends_with "company1.mysite.com"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
I have several other hosts for the same V-server that need to do this as well. I know I can attach individual iRules for each host redirect, i.e. company2.mysite.com, company3.mysite.com, etc. However, is there a way to do this in one rule? My instinct was to do multiple if-else statements for each host in a single rule, but is that the way to go?
Thanks in advance,
- Jericho
- Colin_Walker_12Historic F5 AccountWhat you'll probably want to do is create a data group that stores all of the hosts that you want to redirect. This way you can use the matchclass command to search through the class and determine whether or not the request should be redirected.
- Jericho_Gutierr
Nimbostratus
Thanks! Worked like a charm. FYI, your reply came in a full HOUR ahead of my case with f5 tech support (and they directed me here anyway). Thanks again...
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