Forum Discussion
Joe_Pipitone
Nimbostratus
Jan 28, 2010ssl redirect not working
I have 2 separate VIP's, one for traffic on port 80, another for port 443. They both have the same VIP.
Traffic works fine on both port 80 and 443.
We want to append the www to our domain name if a user tries to go to https://oursite.com
So it should redirect from
https://oursite.com/anyrequest
to
https://www.oursite.com/anyrequest
Can anyone tell me why this iRule wouldn't work? I have applied this to our VIP-sitename-443 VIP which contains an SSL profile. I need to be able to catch oursite.com on port 443 and append the www, so I applied this iRule to the VIP that contains the SSL certificate, however it is not appending the www.
when HTTP_REQUEST {
if { ([HTTP::host] eq "oursite.com") } {
switch -glob [HTTP::uri] {
"/" { HTTP::redirect "https://www.oursite.com" }
default { HTTP::redirect "https://www.oursite.com[HTTP::uri]" }
}
}
}
7 Replies
- hoolio
Cirrostratus
dupe - hoolio
Cirrostratus
What response does the client get when you test the rule with a request to https://oursite.com? I'd expect a cert mismatch error because the cert is for www.oursite.com. - Joe_Pipitone
Nimbostratus
Yep - we get a cert mismatch which is the reason why we need this redirect from https://oursite.com to https://www.oursite.com - hoolio
Cirrostratus
There are three ways to fix this issue: - Joe_Pipitone
Nimbostratus
Thanks for your help - I don't think this is going to help us though.when HTTP_REQUEST { HTTP::redirect https://oursite.org[HTTP::uri] }
when HTTP_REQUEST { if { ([HTTP::host] eq "www.oursite.org") } { switch -glob [HTTP::uri] { "/" { HTTP::redirect "https://oursite.org" } default { HTTP::redirect "https://oursite.org[HTTP::uri]" } } } }
- Minn_62043
Cirrostratus
HTTP_REQUEST comes after the handshake is completed. Client would receive cert mismatch error before LTM returns redirect. - hoolio
Cirrostratus
As Moo suggests, that can't work to avoid a cert mismatch error. Here are three options to resolve this:
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