Ask Yoast:

Redirecting your site to non-www and HTTPS

Let’s say you own the website http://www.some-example.com. After a while, you decide you don’t want to keep the www. You want your visitors to go to the non-www version of your domain instead. What’s more, you’ve also decided to switch from HTTP to HTTPS, to follow security best practices. These two things combined make for quite a move, which may be a bit scary, as it could affect your rankings.

Yoast.com has guides on switching to non-www, as well as on moving your site to HTTPS. But what should you do if you want to make both these changes? What’s the best way to do this? Is there a preferred order?

We received an anonymous question for this Ask Yoast:

“I want to move my site from www and HTTP to non-www and HTTPS… what should I do?
1. Strip www and then force HTTPS;
2. or force HTTPS and then strip www?”

Check out the video or read the answer below!

How to switch from HTTP to HTTPS and www to non-www?

“You should do both at the same time. You should redirect the HTTP link straight to the HTTPS version without the www. Don’t try to do that with two 301 redirects, you should do that in just one 301 redirect.

Forcing HTTPS is something that you need to test really well. There are all sorts of things on your site that probably aren’t HTTPS ready that you should know of upfront. I know it was a lot of hard work to get yoast.com to HTTPS and we don’t even have ads. Especially ad services can be really tough to get working on HTTPS. But you should do it in one go. So it’s really secret option number three: redirect from one to the other straight away, and don’t think about anything else.

If you really can do HTTPS for everything and it works fine, make sure to add an HSTS: ‘Strict Transport Security Header’, which forces everything to be over HTTPS. And then, if the browser sees an HTTP link to your domain in the content somewhere, it will still automatically grab the HTTPS version, thus the right one.

Good luck! “

Read more: How to remove www from your URL »

Ask Yoast series


Check out our must read articles about Technical SEO