The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. SEO best practice : HTTP to HTTPS

    SEO best practice : HTTP to HTTPS

    Technical SEO Issues
    8 5 1.0k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Crocodesign
      Crocodesign last edited by

      What's the best practice to switch from an all HTTP site to an all HTTPS site ?
      No changes to the site structure, just a full site switch to SSL.
      Right now, the site is reachable with HTTP and with HTTPS.

      http://crocodesign.be --> https://crocodesign.be
      http://www.crocodesign.be --> https://crocodesign.be
      https://www.crocodesign.be --> https://crocodesign.be

      CMS : Wordpress 3.9
      Server type : Apache
      Preferred method : .htaccess

      1 Reply Last reply Reply Quote 0
      • TomRayner
        TomRayner last edited by

        The above redirect structure you've proposed would work great.  You're ensuring only one homepage version exists, making it the canonical, and all variations (which may also have previous links going to them and SEO value) are being redirected to pass on to the canonical version.

        You can use your .htaccess file to force http to https by adding the following code:

        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

        The first line turns on redirection capabilities.  The second line checks to make sure the connection is not already https. The third rule will redirect users from their original location, to the same location but using HTTPS.

        And also, in case you want to know how to make sure that the www. version of your site redirects to the non-www version, the code would be:

        RewriteCond %{HTTPS} on
        RewriteCond %{HTTP_HOST} ^www.(.)$ [NC]
        RewriteRule ^(.
        )$ https://%1/$1 [R=301,L]

        Hope this helps

        1 Reply Last reply Reply Quote 3
        • Crocodesign
          Crocodesign last edited by

          Thank you for your reply @TomRoberts
          How can I make sure it's a 301 permanent redirect ?

          Devanur-Rafi 1 Reply Last reply Reply Quote 0
          • Devanur-Rafi
            Devanur-Rafi @Crocodesign last edited by

            You can use any of the HTTP header checkers available online for the purpose or a desktop tool like Screaming Frog SEO Spider can also give you the HTTP header status codes for any URL.

            Best regards,

            Devanur Rafi

            Crocodesign 1 Reply Last reply Reply Quote 0
            • Crocodesign
              Crocodesign @Devanur-Rafi last edited by

              @Rafi : I want to explicity state in the .htaccess rule that a 301 must be used.

              Devanur-Rafi 1 Reply Last reply Reply Quote 0
              • Devanur-Rafi
                Devanur-Rafi @Crocodesign last edited by

                Oh ok...

                This line ensures its a 301:

                RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

                1 Reply Last reply Reply Quote 1
                • KeriMorgret
                  KeriMorgret last edited by

                  We'll also be posting more info about this on the Moz blog later this month.

                  EGOL 1 Reply Last reply Reply Quote 1
                  • EGOL
                    EGOL @KeriMorgret last edited by

                    I wonder why Google's PhD engineers didn't post detailed info about this?....  But, I can probably understand it better from the Moz blog.

                    They also should have warned people that it would tank their adsense earnings.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • What IS SEO FRIENDLY BEST PRACTICE FOR URLS FILTERED 'TAGGED'
                      0
                      1
                      47

                    • Switched from and HTTPS to HTTP. My home page is facing a redirect issue from the http to https. Should I no index the HTTP or find the redirect and delete it? Thank you
                      LandmarkRecovery2017
                      LandmarkRecovery2017
                      0
                      3
                      42

                    • Youtube SEO Best Practices
                      DmitriiK
                      DmitriiK
                      0
                      2
                      4.6k

                    • Bigcommerce only allows us to have https for our store only, not the other pages on our site, so we have a mix of https and http, how is this hurting us and what's the best way to fix?
                      aarongray
                      aarongray
                      0
                      2
                      178

                    • Http vs https: which is better for seo / usability
                      kwoolf
                      kwoolf
                      0
                      2
                      671

                    • https v http is there any difference in rankings what is the best for a online chemist store?
                      NBGnetworks
                      NBGnetworks
                      0
                      5
                      173

                    • SEO url best practices
                      Kibin
                      Kibin
                      0
                      3
                      445

                    • Best method of redirecting http to https on homepage
                      Dr-Pete
                      Dr-Pete
                      0
                      7
                      1.0k

                    Get started with Moz Pro!

                    Unlock the power of advanced SEO tools and data-driven insights.

                    Start my free trial
                    Products
                    • Moz Pro
                    • Moz Local
                    • Moz API
                    • Moz Data
                    • STAT
                    • Product Updates
                    Moz Solutions
                    • SMB Solutions
                    • Agency Solutions
                    • Enterprise Solutions
                    • Digital Marketers
                    Free SEO Tools
                    • Domain Authority Checker
                    • Link Explorer
                    • Keyword Explorer
                    • Competitive Research
                    • Brand Authority Checker
                    • Local Citation Checker
                    • MozBar Extension
                    • MozCast
                    Resources
                    • Blog
                    • SEO Learning Center
                    • Help Hub
                    • Beginner's Guide to SEO
                    • How-to Guides
                    • Moz Academy
                    • API Docs
                    About Moz
                    • About
                    • Team
                    • Careers
                    • Contact
                    Why Moz
                    • Case Studies
                    • Testimonials
                    Get Involved
                    • Become an Affiliate
                    • MozCon
                    • Webinars
                    • Practical Marketer Series
                    • MozPod
                    Connect with us

                    Contact the Help team

                    Join our newsletter
                    Moz logo
                    © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy