Forum Discussion
Robert_Crandall
Nimbostratus
Mar 31, 2008Detecting https in HTTP_REQUEST
I want to do a redirect of a home page, for example:
www.abc.com to www1.abc.com.
Looking at previous forums it was suggested that something like the following will work:
if {[HTTP::host] equals "www.abc.com"} {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "http://www1.abc.com" }
}
}
This looks simple enough, but how can I detect if www.abc.com is coming in via https to redirect to https accordingly?
Thanks,
Bob
- Colin_Walker_12Historic F5 AccountThe only way you'd be able to inspect the data in the packet, if the connection is HTTPS, is if you set up a ClientSSL profile to decrypt the data at the BIG-IP. This would allow you to inspect normally, and then pass the information on. You can re-encrypt it if necessary.
- Nicolas_Menant
Employee
Hi,when CLIENT_ACCEPTED { if { [TCP::local_port] equals "80" } { SSL::disable } when HTTP_REQUEST { if {[HTTP::host] equals "www.abc.com"} { if { [TCP::local_port] equals "80" } { HTTP::redirect "http://www1.abc.com" } } elseif { [TCP::local_port] equals "443" } HTTP::redirect "https://www1.abc.com" } } }
- Nicolas_Menant
Employee
I updated my post due to some mistake i did ... that's what's happening when doing something else at the same time !
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