location of my host

Ask Yoast
Redirecting your site to non-www and HTTPS

Ask Yoast: Redirecting your site to non-www and HTTPS

Let’s say you own the website http://www.some-example.com. At one point, you might like visitors to go to the non-www version instead of the www version of your domain. In addition to this, if you follow security best practices, you might want to switch from HTTP to HTTPS. What should you do if you want to make both these changes? You probably figured out that you’ll have to redirect traffic from your current domain to your preferred domain. But 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!

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO: the #1 WordPress SEO plugin Info

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

Check out the video or read the answer below!

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!

Ask Yoast

In the series Ask Yoast we answer SEO questions from followers. Need some advice about SEO? Let us help you out! Send your question to ask@yoast.com.

Read more: ‘How to remove www from your URL’ »

12 Responses to Ask Yoast: Redirecting your site to non-www and HTTPS

  1. abhinav
    By abhinav on 20 March, 2017

    thanks for this great information.i am also a yoast plugin user.it is a great plugin i am using it on my website http://www.jobdilade.com

  2. Vicky
    By Vicky on 20 March, 2017

    i did a redirect few days back to my new site and still i am waiting to get all link authority as most of the keywords are down now.

  3. Vishnu
    By Vishnu on 18 March, 2017

    Its awesome then i created this comment. The way you all are working is awesome. I have subscribed to your blog. I also have yoast seo for my site

  4. Vishnurexbob
    By Vishnurexbob on 18 March, 2017

    It, s pleasure and great experience to be a part of your awesome content. Can you sujjest me how what is the premium cost incurred for yoast seo.

  5. Multimeta
    By Multimeta on 15 March, 2017

    Thanks for huge information about redirections. Today we got the information that we should be not redirect 301 two time.

  6. CoinFunda
    By CoinFunda on 13 March, 2017

    Hi, Thanks for the post. I need your help. I just started my new project http://coinfunda.com , Pingdom is showing that website loads within 2 seconds, while In google page speed results performance is much poor.
    Please help how can I increase Google speed test toll result.? How can I minimize JS and CSS without disturbing website look n feel?
    Does shared hosting affect SEO also?

  7. Colombia
    By Colombia on 12 March, 2017

    Any recommendation to make the redirection in one rule via htaccess? Or maybe is better to do it in the wp-config or “index.php” directly?

  8. Fotomaton para bodas Madrid
    By Fotomaton para bodas Madrid on 8 March, 2017

    I just changed my sites to https, I installed the security certificates and made the oprtunos changes. While it is very important to search and change all the internal links of the web with the https, since if the browser does not indicate to us that the site is safe.

  9. Farhan
    By Farhan on 8 March, 2017

    Very good article and learnt more about redirecting. Your articles helps me to rank in google and thanks again.

  10. Mike
    By Mike on 8 March, 2017

    Do you recommend doing the redirect in the .htaccess file? Can you provide the code for that? I’ve seen a few different variations out there. What needs to be done in Google search console besides adding the https property, anything? Should you remove the sitemap from the http property and add it to the https property or keep it?

  11. Gaurav Heera
    By Gaurav Heera on 8 March, 2017

    Thanks…………………….For providing this amazing article and video. I hope this will help me to redirect my website to https. HTTPS matters in seo ranking and you’ve done nice job. Thanks for sharing this article please keep posting such an informative article.

  12. Robert
    By Robert on 7 March, 2017

    How do I use Yoast with Elementor page builder?


Check out our must read articles about Technical SEO