Forum Discussion
Steve_Gillis_83
Nimbostratus
Jul 11, 2007Doing an HTTP to HTTPS redirect and need to exclude an address or range
I am using the following irule to redirect users to 443 from 80 and need to exclude either a specific address, or a range of addresses.
Can someone please give me a sample of how to incorpor...
Deb_Allen_18
Jul 12, 2007Historic F5 Account
sure, no problem.
The iRules version is the same as the product version. Some 4.x commands are supported by v9 for backward compatibility, but most have been replaced with newer versions.
I think a simple rule referencing a class (data group list) listing hosts & subnets would work best. First create a class of type Address that includes the hosts & subnets, then create a v9 iRule like this referencing the class (class should be named "HTTPAllowedHosts", otherwise adjust the calss name in the code):
when HTTP_REQUEST {
if {!([matchclass [IP::client_addr] equals $::HTTPAllowedHosts])}{
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
/deb
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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