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. 301 redirect help

    301 redirect help

    Intermediate & Advanced SEO
    6 3 609
    • 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.
    • DanDeceuster
      DanDeceuster last edited by

      Hey guys, I normally work in WordPress and just use a 301 redirect plugin. I bought a site and rather than maintain two similar ones have decided to redirect one to the other.

      I am having trouble with the .htaccess file. Here is an example. These are two redirects:

      redirect 301 /category/models/next/2
      redirect 301 /category/models

      I want both of these URLs to redirect to the same URL of the new site. However, the /category/models is the only one working. It redirects to the new page just fine. The /category/models/next/2 is redirecting to nearly the same URL on the new site, only it is adding /next/2 to the end and that is bringing up a 404.

      Why is it adding /next/2 to the new URL? How can I fix this? There are several doing this. Help appreciated!

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

        Whats in your .htaccess file at the moment?

        I think in your .htaccess your redirect should be setup something along the lines of:

        RewriteCond %{HTTP_HOST} ^www.old-domain.com$ [NC]

        RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]

        Someone else could probably make that a bit neater but something like this should work.

        DanDeceuster 1 Reply Last reply Reply Quote 1
        • DanDeceuster
          DanDeceuster @moesian last edited by

          This is at the top of the .htaccess file:

          rewritecond %{HTTP_HOST} ^www.old-domain.com$ [OR]
          rewritecond %{HTTP_HOST} ^old-domain.com$
          rewriterule ^$ "http://new-domain.com/" [R=301,L]

          Does this need to be changed?

          moesian DanDeceuster Jinx14678 3 Replies Last reply Reply Quote 0
          • moesian
            moesian @DanDeceuster last edited by

            Try changing the last line to:

            RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]

            1 Reply Last reply Reply Quote 0
            • DanDeceuster
              DanDeceuster @DanDeceuster last edited by

              Didn't seem to fix it. None of the redirects worked anymore. They all just changed the domain name, not redirect to the specified URL.

              1 Reply Last reply Reply Quote 0
              • Jinx14678
                Jinx14678 @DanDeceuster last edited by

                Hi,

                I just did this and had similar issues

                It looks like the .htaccess is correct at the old domain.

                but you need to put in re-directors at the new domain that will take in these extra items due to these directories do not exist at the new domain.

                There could be an easier way, without putting a redirect after a redirect (which possibly losses a little extra juice) but I am not aware of a way without redirecting all 404 queries.

                after you have put back the 301 that was working at the OLD domain In the .htaccess at the NEW domain you would put

                Redirect /category/models/next/2 http://www.example.com/

                This will tell any queries for http://www.example.com/category/models/next/2

                to redirect to http://www.example.com or whatever you put in....

                hope this helps!

                1 Reply Last reply Reply Quote 1
                • 1 / 1
                • First post
                  Last post
                • 301 redirection help needed!
                  Nigel_Carr
                  Nigel_Carr
                  3
                  6
                  86

                • 301 redirects broken - problems - please help!
                  CommT
                  CommT
                  0
                  3
                  69

                • Help understanding 301 domain redirect
                  Paddy_Moogan
                  Paddy_Moogan
                  0
                  5
                  114

                • 301 Redirect To Another 301 Redirect
                  cbielich
                  cbielich
                  0
                  5
                  247

                • Big 301 Redirect Help!
                  onwebtoday
                  onwebtoday
                  0
                  2
                  98

                • Time sensitive: HELP! We are having a problem doing a 301 redirect.....what can we do instead?
                  PatriotOutfitters81
                  PatriotOutfitters81
                  0
                  7
                  148

                • How to conduct catch 301 redirects & have the separate 301 redirects for the key pages
                  BenRWoodard
                  BenRWoodard
                  0
                  2
                  288

                • Splitting one Website into 2 Different New Websites with 301 redirects, help?
                  AdamThompson
                  AdamThompson
                  0
                  5
                  3.5k

                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