Forum Discussion
yihwen_100254
Jun 14, 2011Nimbostratus
Generic iRule to redirect domain.com to www.domain.com
Hi
I am planning to create an generic iRule to perform a http://domain.com to https://www.domain.com I know in the F5 v10.x.x, there is a _sys_https_redirect and that will actually redirect ...
Michael_Yates
Jun 14, 2011Nimbostratus
You can apply this to your HTTP Virtual Server.
It will verify if the incoming HTTP::host starts with www and redirect to HTTPS based on the initial compare:
when HTTP_REQUEST {
if {[HTTP::host] starts_with "www."} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
} else {
HTTP::redirect "https://www.[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