Forum Discussion
Robert_Pagano_7
Nimbostratus
Aug 13, 2010immediate redirect when client attempts to access an HTTPS URL that will be going away
This is probably a silly question but I am going to ask it anyway ...
We have a HTTPS site that we will be retiring in the near future.
We want to redirect clients who attempt to browse to that site to be redirected to the new HTTPS site.
I have done something similar to this in the past; but it has been with HTTP requests using the "when HTTP_REQUEST ..." and "HTTP::redirect ..." syntax.
The wrinkle, this time, is that we do not want to maintain (i.e. pay for) the SSL certificate for the old site.
So, is it possible to send a redirect to a client as soon as it attempts to access an HTTPS URL? Something along the lines of a "when HTTPS_REQUEST ..."?
If not, is there any other way to implement such a redirect?
Any guidance at all will be very much appreciated!
- naladar_65658
Altostratus
That is a good question. You would use the when HTTP_REQUEST syntax and use the http::redirect command. Something like this:when HTTP_REQUEST { if { ([string tolower [HTTP::host]] contains "your.websitename.com")} { HTTP::redirect "https://www.yournewwebsitename.com[HTTP::uri]" } }
- Chris_Miller
Altostratus
Are you basically saying that a user will hit an SSL Virtual Server which has an expired Cert? I'm not sure what you meant by "stop paying for." - Robert_Pagano_7
Nimbostratus
Chris: - Chris_Miller
Altostratus
Robert - since "HTTP::redirect" is limited to events that would have occurred after the SSL handshake has been completed at your expired-cert VIP, I don't really see any options here. If others have ideas, please chime in... - George_Watkins_Historic F5 AccountHi Robert,
rule new_site_redirect { when HTTP_REQUEST { HTTP::respond 200 content "example.com has moved \ Example.com has moved to its new home at "
- George_Watkins_Historic F5 AccountApparently the forum clobbered my HTML code, but you get the idea. Just respond with a page that has a link to the new site.
- Robert_Pagano_7
Nimbostratus
Thank you all for your replies. The business has decided to renew the SSL certificate for another year. So, I can do the redirect on the LTM after it handles the client SSL session setup. If, after a year, folks don't realize they have been redirected to a new site ... (Well, I'll just leave it at that!) - hoolio
Cirrostratus
As Chris suggested, you need LTM to decrypt the SSL in order to send an HTTP response back to the client. If you want to avoid a browser warning for an expired or mismatched cert, you'd need to use a valid cert which matches the host name that clients make requests to.
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