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. Intermediate & Advanced SEO
    4. Best practice to redirect http to https

    Best practice to redirect http to https

    Intermediate & Advanced SEO
    5 2 1.7k
    • 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.
    • Gavpeds
      Gavpeds last edited by

      I have an SSL certificate on our domain but at times some search results still list the HTTP version. Clicking on this then warns the user about security and they leave. To avoid this I am using this in the htaccess file to redirect all HTTP visits to the https version.

      RewriteEngine On
      RewriteCond %{SERVER_PORT} 80
      RewriteRule ^(.*)$ https://domain.com/$1 [R,L]

      Is this ok? I notice on Moz toolbar it give a 302 temporary redirect I am thinking this isn't good and needs to be a 301 maybe? What is the best practice in this situation?

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

        Hi,

        I should advise a 301 perm. redirect. remember, it wil take some time before google index all your new pages ( 6 weeks)

        don;t forget to add your new domain to search console.

        Kind regards,

        Jeroen

        Gavpeds 1 Reply Last reply Reply Quote 0
        • Gavpeds
          Gavpeds @chalet last edited by

          Thanks, i have added the new domain to search console. How do you set priority domain?

          Also in regard to the code i have in htaccess. What do i need to add to it to make it do a 301?

          Thanks

          chalet 1 Reply Last reply Reply Quote 0
          • chalet
            chalet @Gavpeds last edited by

            Sorry i mean prefferd domain 🙂 https://support.google.com/webmasters/answer/44231?hl=en

            I'm not familiar with customizing a htaccess file.

            Kind regards,

            Jeroen

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

              Ok thanks anyone know what i need to do to adjust my htaccess code?

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Best practice to redirect all 404s?
                KevinBudzynski
                KevinBudzynski
                0
                2
                65

              • Mass URL changes and redirecting those old URLS to the new. What is SEO Risk and best practices?
                Charles-O
                Charles-O
                0
                6
                465

              • Domain Level Redirects - HTTP and HTTPS
                ChrisHallUK
                ChrisHallUK
                0
                3
                656

              • Would you redirect Website A to Website B, when Website B is in the middle of a HTTP=>HTTPS migration?
                jeremycabral
                jeremycabral
                0
                3
                62

              • Switching from HTTP to HTTPS: 301 redirect or keep both & rel canonical?
                Steven_Macdonald
                Steven_Macdonald
                0
                9
                3.1k

              • What are the best practices with website redesign & redirects?
                PatrickDelehanty
                PatrickDelehanty
                0
                2
                148

              • HTTPS Login on HTTP Site | 301 or 302 Redirect?
                Cyrus-Shepard
                Cyrus-Shepard
                0
                4
                1.2k

              • When migrating website platforms but keeping the domain name how best do we add the new site to google webmaster tools? Best redirect practices?
                WNL
                WNL
                0
                6
                462

              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