Forum Discussion
Mike_27130
Nimbostratus
Jun 18, 2010Having trouble with mangled https:// request
I have a site where a large scale communication was sent to go to mysite.com instead of www.mysite.com.
It is a secure SSL site
I wrote to try to fix the lack of the "www" this works on the redirect for
"http://mysite.com"
but not for
"https://mysite.com" --- This generates an ssl cert error before the irule change the host
I believe the host must be changed before the SSL connection is established. Is there a way to do this?
when HTTP_REQUEST{
if { not (HTTP::host] starts_with "www." ) } {
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}else{
HTTP::respond 301 Location "https://[getfield[HTTP::host] :1 [HTTP::uri]"
}
}
- Michael_Yates
Nimbostratus
Unfortunately the situation you are in can’t be fixed by an iRule. - hoolio
Cirrostratus
As Michael suggested, you can't fix this with an iRule which redirects to the correct hostname. You could either rewrite the references to https://mysite.com to https://www.mysite.com before the client makes a request to the wrong hostname, or you could get a UCC cert which is valid for www.mysite.com and mysite.com. - Mike_27130
Nimbostratus
Thanks - It makes sense now. Bad news but makes sense.
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