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. 302 or 301 redirect to https ?

    302 or 301 redirect to https ?

    Technical SEO Issues
    9 4 33.6k
    • 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.
    • Kotkov
      Kotkov last edited by

      I am redirecting whole site to https. Is there a difference between 302 or 301 redirect for seo?

      Site never been indexed.

      Planning to do that with .htaccess command

      RewriteCond %{HTTPS} !=on
      RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

      There are plenty of ways http://www.askapache.com/htaccess/ssl-example-usage-in-htaccess.html

      Which way would be the best?

      Thanks is advance

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

        301 = permanent redirection

        302 = temporary redirection

        If the change is permanent then 301

        The htaccess rewrite looks fine 🙂

        Kotkov 1 Reply Last reply Reply Quote 0
        • Kotkov
          Kotkov @wojkwasi last edited by

          Thanks, I understand 301 and 302. This command creates 302. I see a lot of website in serp having 302 to https, but also I see a lot with 301. Which is right for Seo when in comes to https?

          wojkwasi 1 Reply Last reply Reply Quote 0
          • wojkwasi
            wojkwasi @Kotkov last edited by

            301 - try this (in it's simplest form):

            RewriteCond %{SERVER_PORT} 80 
            RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
            
            1 Reply Last reply Reply Quote 1
            • ShaMenz
              ShaMenz last edited by

              Hi Serge,

              The reason your redirect is creating a 302 is that it is an unspecified Redirect.

              Any redirect that is unspecified will by default be seen as a 302 (Temporary)

              To create a 301, you need to specify like this

              [R=301,L]
              

              Hope that helps,

              Sha

              wojkwasi 1 Reply Last reply Reply Quote 2
              • wojkwasi
                wojkwasi @ShaMenz last edited by

                Hi Sha - I think you meant Serge not Woj 😉

                But yes, good pick up - I omitted that detail in my hasty reply

                ShaMenz 1 Reply Last reply Reply Quote 0
                • ShaMenz
                  ShaMenz @wojkwasi last edited by

                  oops,

                  Thanks for the pickup 🙂

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

                    HTTPS based sites normally add a little stress to the server for handling requests, make sure you are hosted on a good performance web host for users & search engines to access content fast. If you're making HTTPS as the default version and if bots take time to crawl your website, it might after your crawl rate (and possibly ranking)

                    Just like how we see WWW and non-WWW, HTTP and HTTPS are looked as two different sites by search engines, I'd highly suggest you to go with 301 (permanent) re-direct from the start to save link juice. Keep your SSL certifications valid. If you don't intend to do 301 from start, check your logs often to see if you get any links to HTTP version (as most often people try to link here) and request webmasters to update the link to HTTPS if you want to see your HTTPS version ranking in SERPs.

                    My personal suggestion is to stick with one and doing 301 before you launch the site live.

                    Cheers

                    Kotkov 1 Reply Last reply Reply Quote 1
                    • Kotkov
                      Kotkov @Virrtuo last edited by

                      Thanks,

                      Yes the site from the beginning will be https. We do have a good server, site speed according to google speed tool is 93.

                      Sha, added  [R=301,L] and now it's 301.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      • Http -> https redirections / 301 the right way
                        Andy.Drinkwater
                        Andy.Drinkwater
                        0
                        4
                        61

                      • How to change 302 redirect from http to https
                        davedon
                        davedon
                        0
                        4
                        2.1k

                      • Redirecting 301 or 302?
                        HypermediaSystems
                        HypermediaSystems
                        0
                        5
                        223

                      • Redirect 302 status code to 301 status code
                        rijwielcashencarry040
                        rijwielcashencarry040
                        0
                        5
                        145

                      • Redirect a 301 Redirect
                        RedCaffeine
                        RedCaffeine
                        0
                        5
                        98

                      • 302 Redirect from HTTP to HTTPS
                        corwin
                        corwin
                        0
                        2
                        486

                      • 301 redirect or 302
                        RuudHeijnen
                        RuudHeijnen
                        0
                        3
                        601

                      • Worth Changing Redirect From 302 to 301?
                        dawnieando
                        dawnieando
                        0
                        7
                        832

                      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