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 for synonyms and related keywords and prevent broken pages on your site 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
    abhinav  • 2 years ago

    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
    Vicky  • 2 years ago

    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
    Vishnu  • 2 years ago

    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
    Vishnurexbob  • 2 years ago

    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
    Multimeta  • 2 years ago

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

  6. CoinFunda
    CoinFunda  • 2 years ago

    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
    Colombia  • 2 years ago

    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
    Fotomaton para bodas Madrid  • 2 years ago

    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
    Farhan  • 2 years ago

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

  10. Mike
    Mike  • 2 years ago

    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
    Gaurav Heera  • 2 years ago

    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
    Robert  • 2 years ago

    How do I use Yoast with Elementor page builder?

    Thanks!


Check out our must read articles about Technical SEO

rel=canonical: the ultimate guide

The canonical URL allows you to tell search engines that certain similar URLs are actually one and the same. Learn how to use rel=canonical!

Read article »

hreflang: the ultimate guide

This guide discusses what hreflang is, what it is for and gives in-depth information on how to implement it for your multilingual websites.

Read article »

robots.txt: the ultimate guide

The robots.txt file is a file you can use to tell search engines where they can and cannot go on your site. Learn how to use it to your advantage!

Read article »