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. Other Research Tools
    4. 301/302 header

    301/302 header

    Other Research Tools
    5 2 385
    • 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.
    • 12tix
      12tix last edited by

      Hi,
      I changed from http to https with SSL certificate and have added the following code in my htaccess:

      RewriteEngine On
      RewriteCond %{HTTPS} !^on$
      RewriteRule (.*) https://www.mysitesurl.com/$1 [R,L]

      RewriteCond %{HTTP_HOST} !^www.
      RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

      But Moz returns a:
      Temporary Redirect
      Using HTTP header refreshes, 302, 303, or 307 redirects will cause search engine crawlers to treat the redirect as temporary and not pass any link equity to other pages. We highly recommend that you replace temporary redirects with 301 redirect

      And additional header checkers return a 302 also when I check http://www.mysitesurl.com/:
      HTTP/1.1 302 Found =>
      Date => Tue, 05 May 2015 09:31:18 GMT
      Server => Apache/2
      _Location => https://www.mysitesurl.com/_
      Content-Length => 214
      Connection => close
      Content-Type => text/html; charset=iso-8859-1

      Anybody an idea why there is no 301 result?

      Thanks

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

        Going to need the actual URL I think. If you can't post here, PM it - but I don't see the issue.

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

          Ok thanks for the PM. I see the issue now - didn't need the URL after all, just a few more minutes to process.

          The redirect is matching the first rule. You only have R,L so R by itself defaults to 302.  It's picking up that before the other rule so it stops processing.

          Set the top rule to R=301 and make sure you see a true 301 after that. If not, I'm wrong. haha  But I think that's it.

          12tix 1 Reply Last reply Reply Quote 1
          • 12tix
            12tix @MattAntonino last edited by

            Hi Matt,

            Thanks for that, have changed the code as you advised to:

            RewriteEngine On
            RewriteCond %{HTTPS} !^on$
            RewriteRule (.*) https://www.mysitesurl.com/$1 [R**=301**,L]

            RewriteCond %{HTTP_HOST} !^www.
            RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

            and it seems to work!
            HTTP/1.1 301 Moved Permanently =>
            Date => Tue, 05 May 2015 12:07:49 GMT
            Server => Apache/2
            Location => https://www.mysitesurl.com/
            Content-Length => 238
            Connection => close
            Content-Type => text/html; charset=iso-8859-1

            Thanks a bunch!!!

            MattAntonino 1 Reply Last reply Reply Quote 0
            • MattAntonino
              MattAntonino @12tix last edited by

              Perfect, glad it helped! 🙂

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • How To Stop Moz Crawl From Prepending /blog/ on all our site urls that it crawls
                samantha.chapman
                samantha.chapman
                1
                2
                32

              • Http:// https:// google search console crawl errors
                O.D.
                O.D.
                0
                5
                355

              • 301 Redirects detected as duplicates
                ChiarynMiranda
                ChiarynMiranda
                0
                2
                88

              • Why RogerBot can't crawl site https://unplag.com
                Targeras
                Targeras
                0
                10
                540

              • Spam score 9/17 and redirect Question
                onlinegusto
                onlinegusto
                0
                5
                948

              • Link to hotels on http://moz.com/mozcon doesn't work
                Andy-Halliday
                Andy-Halliday
                0
                6
                136

              • Moz / more changes on the way?
                adamf
                adamf
                1
                3
                143

              • Moz Analytics/Reports into PDF
                ThompsonPaul
                ThompsonPaul
                1
                2
                170

              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