Forum Discussion
Pete_Paiva_7147
Nimbostratus
Apr 02, 2013HTTPS redirect
Hi all,
Is there an iRule equivalent to this but for HTTPS?
when HTTP_REQUEST {
HTTP::redirect https://www.mysite.com
Kevin_Stewart
Employee
May 01, 2013The above iRule is a "catch all". Without any conditions, it will redirect any request to the HTTPS VIP regardless of the host or URI values. So a call to https://www.abc.com/form/siet/bra will just get redirected to http://www.abc.com/form/siet/bra. In order to be able to access ANY HTTPS content, you need some form of conditional evaluation in your iRule logic. For example, to only allow access to /form/siet/bra content on the HTTPS VIP, and redirect everything else, you might use an iRule like this on your HTTPS VIP:
when HTTP_REQUEST {
if { not ( [string tolower [HTTP::uri]] starts_with "/form/siet/bra" ) } {
HTTP::redirect "http://[HTTP::host][HTTP::uri]"
}
}
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