Redirect all site traffic from to

Hi Guys,

I've got an issue where I need to redirect all site traffic to the subdomain www. This is because the SSL certificate uses a SAN which is specifically If a user goes to they get an SSL warning because the SAN doesn't match that URL. I can't change that unfortunately as that's what the customer has bought. I also have to redirect all traffic to HTTPS.

I have a redirect working for all HTTP traffic using the following in apache in the website conf file (using Mod Rewrite)

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^example\$ [NC]
RewriteRule (.*){REQUEST_URI} [R,L]

This works fine until a user goes to when it doesn't redirect.

I was wondering if I'd botched the rules somehow? If not, is what I'm trying to do possible before the user gets an SSL error or would I have to find some way of redirecting before the users hits the server and gets the SSL certificate? Can Linodes DNS tools do this somehow?


2 Replies

SSL/TLS authentication happens before the redirect can ever take place. The only thing you can do is re-issue the certificate to cover both and Most SSL providers will do a re-issue for www/bare domain issues, if you can convince the customer to go back to their provider — otherwise, you might consider trying out Let's Encrypt.

That's what I was assuming. I was wondering if there was anything I could do before it hit the SSL authentication.

I can get them to remake the certificate (which is really easy actually) but it will mean them having to spend more money on certificates down the line which they don't want to do.

Let's Encrypt looks interesting! I haven't heard of them, I wonder if there are any known issues with browsers using certificates from there? EDIT: As soon as I posted that I found this… … crypt/4394">


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct