undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Technical SEO
  4. 302 or 301 redirect to https ?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

302 or 301 redirect to https ?

Technical SEO
4
9
35.7k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • Kotkov
    Kotkov last edited by Feb 18, 2012, 10:41 PM

    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
    • Kotkov
      Kotkov @Virrtuo last edited by Feb 19, 2012, 4:19 AM Feb 19, 2012, 4:19 AM

      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
      • Virrtuo
        Virrtuo last edited by Feb 19, 2012, 2:59 AM Feb 19, 2012, 2:59 AM

        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 Feb 19, 2012, 4:19 AM Reply Quote 1
        • ShaMenz
          ShaMenz @wojkwasi last edited by Feb 19, 2012, 2:36 AM Feb 19, 2012, 2:36 AM

          oops,

          Thanks for the pickup 🙂

          1 Reply Last reply Reply Quote 0
          • wojkwasi
            wojkwasi @ShaMenz last edited by Feb 19, 2012, 2:34 AM Feb 19, 2012, 2:34 AM

            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 Feb 19, 2012, 2:36 AM Reply Quote 0
            • ShaMenz
              ShaMenz last edited by Mar 2, 2012, 8:59 PM Feb 19, 2012, 2:06 AM

              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 Feb 19, 2012, 2:34 AM Reply Quote 2
              • wojkwasi
                wojkwasi @Kotkov last edited by Feb 19, 2012, 1:54 AM Feb 19, 2012, 1:53 AM

                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
                • Kotkov
                  Kotkov @wojkwasi last edited by Feb 19, 2012, 1:36 AM Feb 19, 2012, 1:36 AM

                  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 Feb 19, 2012, 1:53 AM Reply Quote 0
                  • wojkwasi
                    wojkwasi last edited by Feb 19, 2012, 12:24 AM Feb 19, 2012, 12:24 AM

                    301 = permanent redirection

                    302 = temporary redirection

                    If the change is permanent then 301

                    The htaccess rewrite looks fine 🙂

                    Kotkov 1 Reply Last reply Feb 19, 2012, 1:36 AM Reply Quote 0
                    • 1 / 1
                    1 out of 9
                    • First post
                      1/9
                      Last post

                    Got a burning SEO question?

                    Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                    Start my free trial


                    Browse Questions

                    Explore more categories

                    • Moz Tools

                      Chat with the community about the Moz tools.

                    • SEO Tactics

                      Discuss the SEO process with fellow marketers

                    • Community

                      Discuss industry events, jobs, and news!

                    • Digital Marketing

                      Chat about tactics outside of SEO

                    • Research & Trends

                      Dive into research and trends in the search industry.

                    • Support

                      Connect on product support and feature requests.

                    • See all categories

                    Related Questions

                    • joony

                      Redirecting HTTP to HTTPS - How long does it take Google to re-index the site?

                      hello Moz We know that this year, Moz changed its domain to moz.com from www.seomoz.org
                      however, when you type "site:seomoz.org" you still can find old urls indexed on Google (on page 7 and above) We also changed our site from http://www.example.com to https://www.example.com
                      And Google is indexing both sites even though we did proper 301 redirection via htaccess. How long would it take Google to refresh the index? We just don't worry about it? Say we redirected our entire site. What is going to happen to those websites that copied and pasted our content? We have already DMCAed their webpages, but making our site https would mean that their website is now more original than our site? Thus, Google assumes that we have copied their site? (Google is very slow on responding to our DMCA complaint) Thank you in advance for your reply.

                      Technical SEO | Nov 24, 2014, 11:40 PM | joony
                      0
                    • Silviu

                      301 redirect relative or absolute path?

                      Hello everyone, Recently we've changed the URL structure on our website, and of course we had to 301 redirect the old urls to the coresponding new ones. The way the technical guys did this is: "http://www.domain.com/old-url.html" 301 redirect to "/new-url.html"
                      meaning as a relative redirect path, not an absolute one like this:
                      "http://www.domain.com/old-url.html" 301 redirect to "http://www.domain.com/new-url.html" This happened for few thousands urls, and the fact is the organic traffic dropped for those pages after this change. (no other changes were made on these pages and the new urls are as seo friendly as possible, A grade on On-Page Grader). The question is: does the relative redirect negatively affects seo, or it counts the same as an absolute path redirect? Thanks,
                      S.

                      Technical SEO | Oct 24, 2013, 7:01 AM | Silviu
                      0
                    • Natitude

                      Best Practice on 301 Redirect - Images

                      We have two sites that sell the same products. We have decided to retire one of the sites as we'd like to focus on one property. I know best practice is to redirect apples to apples, which in our case is easily done since the sites sold the same thing. www.SiteABC.com/ProductA can be redirected to www.SiteXYZ.com/ProductA. My question is how far does that thinking go regarding images? Each product has a main product page, of course, and then up to 6 images in some cases. Is it necessary to redirect www.SiteABC.com/ProductA-Image1.jpg to www.SiteXYZ.com/ProductA-Image1.jpg? Or can they all be redirected to just the product page?

                      Technical SEO | Aug 16, 2013, 2:45 AM | Natitude
                      0
                    • IM_Learner

                      301 Redirect on a PDF, DOCX files?

                      Hi, I have to rename many pdf and docx files. How can I implement 301 redirect on them as they are linked from 'n' number of places? Regards, Shailendra Sial

                      Technical SEO | Jul 31, 2012, 9:53 AM | IM_Learner
                      1
                    • Evo

                      Loss of search engine positions after 301 redirect - what went wrong?!?

                      Hi Guys After adhering to the On Page optimisation suggestions given by SEOmoz, we redirected some of old urls to new ones.  We set 301 redirects from the old pages to new on a page by page basis but our search engine ranking subsequently fell off the radar and lost PR. We confirmed redirection with fiddler and it shows 301 permanent redirect on every page as expected. To manage redirection using a common code logic we executed following: In Http module, using “rewrite path” we route “all old page requests” to a page called “redirect.aspx? oldpagename =[oldpagename]”.  This happens at server side. In redirect.aspx we are redirecting from old page to new page using 301 permanent redirect. In the browser, when old page is requested, it will 301 redirect to new page. In hope we and others can learn from our mistakes - what did we do wrong ?!? Thanks in advance. Dave - www.paysubsonline.com

                      Technical SEO | Jan 16, 2012, 8:27 AM | Evo
                      0
                    • SamTurri

                      Any way around buying hosting for an old domain to 301 redirect to a new domain?

                      Howdy. I have just read this QA thread, so I think I have my answer. But I'm going to ask anyway! Basically DomainA.com is being retired, and DomainB.com is going to be launched. We're going to have to redirect numerous URLs from DomainA.com to DomainB.com. I think the way to go about this is to continue paying for hosting for DomainA.com, serving a .htaccess from that hosting account, and then hosting DomainB.com separately. Anybody know of a way to avoid paying for hosting a .htaccess file on DomainA.com? Thanks!

                      Technical SEO | Dec 7, 2011, 2:37 PM | SamTurri
                      0
                    • Ant-808

                      How long will Google take to stop crawling an old URL once it has been 301 redirected

                      I need to do a clean-up old urls that have been redirected in sitemap and was wondering about this.

                      Technical SEO | Nov 4, 2011, 2:41 PM | Ant-808
                      0
                    • EvergladesDirect

                      200 Redirects for SEO instead of 301

                      We are working with a company on re-platforming our website.  On a call yesterday they outlined a strategy to use 200 redirects for our top keywords instead of 301s.  I am not familiar with this type of redirect and was wondering if anyone could provide some more insight.

                      Technical SEO | Jun 1, 2011, 3:20 PM | EvergladesDirect
                      0

                    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
                    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

                    Access all your tools in one place. Whether you're tracking progress or analyzing data, everything you need is at your fingertips.

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

                    Looks like your connection to Moz was lost, please wait while we try to reconnect.