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 incorporate this into my script?
Thanks - Steve G.
iRule to redirect HTTP to HTTPS
===============================
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
- William_Wash_98
Nimbostratus
You should be able to use the IP::client_addr command to return the IP address of the client, and then determine if it needs to be redirected. - Steve_Gillis_83
Nimbostratus
Unfortunately, that syntax is not accurate. Can you reply back with it as it would be coded? - Deb_Allen_18Historic F5 AccountHi Steve --
- Steve_Gillis_83
Nimbostratus
BIG-IP 9.4.0 Build 517.5 - Deb_Allen_18Historic F5 Accountsure, no problem.
when HTTP_REQUEST { if {!([matchclass [IP::client_addr] equals $::HTTPAllowedHosts])}{ HTTP::redirect https://[HTTP::host][HTTP::uri] } }
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