Forum Discussion
Pradeep_Siwach_
Jul 17, 2012Nimbostratus
HTTPS Request irule
Hi,
We have VS with SSL client profile and the redirection irule configured for HTTP VS.
Currently the site www.xyz.com or xyz.com get redirected to https://www.xyz.com due to irul...
Brian_Van_Stone
Jul 17, 2012Nimbostratus
[HTTP::host] should return "xyz.com" when https://xyz.com is requested. Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "xyz.com" } {
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}
}
This iRule needs to go on the https VS, not the http one.
Notice that you don't need to check the port if you only put this iRule on your 443 VS. Keep in mind, however, that if https://xyz.com results in a certificate error because of a host name mismatch that this error will still be encountered as the request without the www is already being served. Here is a good article on the host name mismatch fun.
https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/265/Can-iRules-fix-my-cert-mismatch-errors.aspx
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