Forum Discussion
Glenn_Ruffus_10
Nimbostratus
Dec 18, 2007Force "www." redirect if missing from HTTPS requests
I am looking for help in writing an iRule that will be used on an HTTPS virtual server. I would like the LTM to examine the HTTP request and if the URL does not include "www." then redirect the brows...
Colin_Walker_12
Dec 18, 2007Historic F5 Account
For this kind of a rule all you'd need is something like:
when HTTP_REQUEST {
if { ! ( [HTTP::host] starts_with "www." ) } {
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}
}
Keep in mind, though, that you'll have to have a Client SSL profile assigned to this Virtual, which will decrypt the data to allow TMoS to inspect it.
HTH,
Colin
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