Forum Discussion
veyond_113181
Mar 13, 2007Nimbostratus
redirect domain.com to https://www.domain.com
I am using a http redirect rule to redirect all http traffic to https. That works fine but the problem I am having is that the SSL cert is only for www.domain.com. The client is very picky and wants...
Mar 14, 2007
The value of HTTP::host does not include the protocol specifier. This should work for you.
when HTTP_REQUEST {
if { [HTTP::host] eq "domain.com" } {
HTTP::redirect "https://www.domain.com[HTTP::uri]"
}
}
The only issue you need to be aware of with redirects is that you don't to get into a infinite loop where you keep redirecting to the same iRule recursively.
Theoretically it's best practice to create separate virtuals for each port (80 and 443). This will also help avoid recursive redirection.
-Joe
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