Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are migrating web host and I wonder if it is possible in the migration phase to do a CNAME forward from https://address1.com to http://address2.com. Would the certificate still work even if the new domain doesn't have SSL yet?

share|improve this question
To answer the second question - the certificate won't work as it's tied to the domain name. You'll have to buy a new one. – paulmorriss Feb 10 '12 at 9:32
Thanks for your answer! – Anders Eriksson Mar 4 '12 at 9:17

Yes it's possible to do the forward, but it won't work, you'd need a new certificate as @paulmorriss points out in the comments.

share|improve this answer
If there's a delay in getting your CA-signed certificate, you can temporarily used a self-signed certificate. This will throw up warnings in the browser unfortunately, but it is the best thing for protecting the user. – Lèse majesté Feb 10 '12 at 10:35
@Lèsemajesté I did not know you could do that - is there a tutorial you know of on setting such a thing up? – toomanyairmiles Feb 10 '12 at 10:38
I've never set it up on a Windows system, but on Linux it's fairly easy. Here's a good tutorial for that. If you're using shared hosting, then you'll have to go through your hosting admin panel to install the certificate, though many web hosts will generate & install it for you when you enable HTTPS on a domain without purchasing a signed cert. – Lèse majesté Feb 10 '12 at 10:43
@Lèsemajesté great tip, cheers. – toomanyairmiles Feb 10 '12 at 10:44
Thanks @toomanyairmiles! – Anders Eriksson Mar 4 '12 at 9:18

A CNAME record does not "forward" anything, nor does it have anything to do with either HTTP or HTTPS protocols.

A CNAME record basically tells your nameserver that the record is an alias for another (A) record and it should lookup the value for that. For example:

example.com. IN CNAME example.net.

Would make your nameserver query example.net A-record, which could be like:

example.net. IN A

If you want to redirect from one domain to another, with a different protocol, you will have to instruct either your webserver or the visitor's browser to redirect the request. There are some ways to do that.

  1. (Apache only) Create an .htaccess file in your DocumentRoot with a rule like:

    Redirect / http://example.net/

  2. Place an index.html file in your DocumentRoot with a META refresh to the secondary domain:

    <meta http-equiv="refresh" content="0;url=http://example.net/">

  3. Do something similar, but with a scripting language like PHP, for example an index.php file with:

    <?php header('Location: http://example.net/'); exit; ?>

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.