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. Tricky 301 question

    Tricky 301 question

    Intermediate & Advanced SEO
    16 5 235
    • 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.
    • AndyMacLean
      AndyMacLean last edited by

      A friend has relaunched a website but his web guys (he didn't consult me!) didn't do any 301s and now traffic unsurprisingly has tanked.

      The old site and database no longer exists and there are now 2000+ 404's.

      Any ideas how to do the 301s from old urls to new product urls WITHOUT it being a massive manual job?

      1 Reply Last reply Reply Quote 0
      • Yeeply.com
        Yeeply.com last edited by

        Hello Andy,

        1. Try this: http://webdesign.about.com/od/htaccess/ht/redirect-an-entire-site-using-htaccess.htm

        2. Second/faster solution. You could add this line of code to your .htacess file (and all the current "404's users" will go to the homepage):

        ErrorDocument 404 / 

        But pay attention... 404's are perfectly normal if the page no longer exists, for user experience you should only ever use a 301 redirect if the page that no longer exists is going to a equal page.. i.e about cars to cars, about rabbits to rabbits. Maybe the only solution is creating a 404 specific landing page for this (with links to different sections of your site)

        Hope this helps,

        Luis

        AndyMacLean 1 Reply Last reply Reply Quote 1
        • osaka73
          osaka73 last edited by

          2000+ is a lot of URLs to work through.  But you can most likely get through them quickly with a few good regular expression 301 redirects in your .htaccess

          If you have a pretty consistent form from the old url to the new one, this will be a piece of cake.

          ex:
          old URL: this/was/cool

          new URL: this/is/cool

          However, if there is really no rhyme and reason to the newly formed URLs, this could end up taking a considerate amount of time.

          I would look into writing 301 redirects with regular expressions in .htaccess  (I'm assuming your server is  and uses .htaccess)

          There are a number of resources for doing this, and even one here at moz.com
          https://moz.com/learn/seo/redirection

          AndyMacLean 1 Reply Last reply Reply Quote 0
          • DonnaDuncan
            DonnaDuncan last edited by

            It really depends on the nature, link and traffic patterns of your site Andy. If the vast majority of those 2,000+ 404's are coming from pages that should never have been indexed in the first place, you can probably get away with Luis's 2nd suggestion. If they're differentiated, valuable, and show evidence of incoming links and traffic, you've got some work ahead of you.

            You might be able to streamline the process by inventorying and grouping like pages, then doing group redirects. But I suggest you do some analysis first to determine whether the effort is warranted.

            Yeeply.com 1 Reply Last reply Reply Quote 1
            • Yeeply.com
              Yeeply.com @DonnaDuncan last edited by

              Donna,

              Andy has been very specific about this: "WITHOUT it being a massive manual job" hehe 🙂 thanks for supporting my answer.

              Luis

              DonnaDuncan 1 Reply Last reply Reply Quote 3
              • DonnaDuncan
                DonnaDuncan @Yeeply.com last edited by

                Yeah. I heard him. I guess I'm saying "probably not".

                I like how you're keeping us honest though Luis. I don't like it when people respond with what they want to say rather than with an answer to the specific question.

                AndyMacLean 1 Reply Last reply Reply Quote 2
                • AlanMosley
                  AlanMosley last edited by

                  do you know if they had any external links?

                  If they don't have external links then I would just let them 404.
                  some people have some wired thoughts of what 301's do. They simply redirect a request, so a request o A is told to remake the request to to B, so the crawler will follow it that way and award the pagerank to the new page with a small loss on each request.

                  If no external links what is there to gain? don't complicate your site with unnesasary redirects, there is a small argument that the pages may have been bookmarked at old url, but I think that argument is so weak I would not bother

                  AndyMacLean 1 Reply Last reply Reply Quote 0
                  • AndyMacLean
                    AndyMacLean @Yeeply.com last edited by

                    Thanks Luis, unfortunately neither 1 or 2 are ideal.

                    1. I don't think there is much logic in the change of url structure between old and new product urls which makes that idea impossible.

                    2. Thats going to be a last resort 😞

                    Andy

                    1 Reply Last reply Reply Quote 0
                    • AndyMacLean
                      AndyMacLean @osaka73 last edited by

                      Thanks, the regex is a good idea and might be part of the solution for some urls at least but there seems to be some discrepancies in logic between old and new product urls and some of the new product urls are actually still the same as the old (which of course is fine).

                      osaka73 1 Reply Last reply Reply Quote 0
                      • AndyMacLean
                        AndyMacLean @DonnaDuncan last edited by

                        Thanks Donna & Luis. Luis is right i'm looking for a way for this not to be a mammoth manual task for their developer.

                        1 Reply Last reply Reply Quote 0
                        • AndyMacLean
                          AndyMacLean @AlanMosley last edited by

                          Thanks Alan, yes they have good external links to many pages. They retail a very niche product and have a lot of forum, review, social type links. It might be though if need be they just have to focus mostly on 301s for the pages with those links. As best practise I am in favour of 301'ing regardless of external links as the link equity gets messed up and causes ranking issues, as in this case, as well as sending a signal to the engines about the amount of wasted resource they will use crawling a site with 1000s of 404s.

                          1 Reply Last reply Reply Quote 0
                          • osaka73
                            osaka73 @AndyMacLean last edited by

                            If the majority of URLs have no logic, then it makes things a bit tricky in regards to minimizing the amount of work.

                            I once had a very active and large website with about 500-1000 single lines of rewrite code (1 for each URL) in my htaccess.  Surprisingly, it did not slow the server down at any noticeable rate, unless you are very sensitive to milliseconds and even then, one trial to the next could easily differ from regular internet congestion.  My point is, nobody ever noticed.

                            Here's a few ways that I would handle this job to get through it as quickly and effortlessly as possible.

                            The more aggressive and time consuming approach:
                            I would output all the URLs that were changed from phpmyadmin or whatever mysql administration tool you might use to a spreadsheet.  From that spreadsheet, I would add the original URL.
                            Then with the old URL (A1) and new URL (A2)  I would write a formula to output the correct rewrite (A3.)  Then simply copy and paste that formula down all the rows that it applies to.  You might need to break up the URLs to grab the right pieces for your formula.

                            Of course use, regex where you can, and keep your .htaccess rewrites to a minimum.

                            If that is still too much work, hire someone to do it through elance.com

                            The somewhat sloppy pace-yourself-approach:

                            Another approach you could take is to just monitor google webmaster tools for all the page not found errors.  And once a day or once a week, grab those URLS, create the rewrite, and mark it as fixed in webmaster tools.

                            The reason I say this is somewhat sloppy is because, you might find that you could have used regex in a lot of instances to better handle all those missing URLs.

                            But it may be a good way of staying on track with google, and handling the issues only as they arise so it does not feel like such a mammoth task.

                            AndyMacLean 1 Reply Last reply Reply Quote 2
                            • AlanMosley
                              AlanMosley last edited by

                              I don't know what you mean about link equity, if there is no link pointing to the page then there is nothing lost.
                              As for search engines finding a lot of 404s, they will remove them from the index after a while, no problem there, you are returning the correct status code, that's what they want. This will allow them to clean up there index and stop crawling the pages.

                              AndyMacLean 1 Reply Last reply Reply Quote 0
                              • AndyMacLean
                                AndyMacLean @AlanMosley last edited by

                                Pages dont just get equity from external links of course. If a category page has 10 links to it the product pages linked to on that page benefit. The wholesale drop in rankings isn't because every page had an external link to it.

                                AlanMosley 1 Reply Last reply Reply Quote 0
                                • AndyMacLean
                                  AndyMacLean @osaka73 last edited by

                                  Thanks

                                  1 Reply Last reply Reply Quote 0
                                  • AlanMosley
                                    AlanMosley @AndyMacLean last edited by

                                    That's my point, you only need to worry about the pages that had external links
                                    Thanks

                                    1 Reply Last reply Reply Quote 0
                                    • 1 / 1
                                    • First post
                                      Last post
                                    • 301 Question - issue
                                      effectdigital
                                      effectdigital
                                      0
                                      2
                                      73

                                    • A Really Specific Question about 301 Redirect Strategies
                                      DonnaDuncan
                                      DonnaDuncan
                                      0
                                      2
                                      83

                                    • HTTPS 301 Redirect Question
                                      Brando16
                                      Brando16
                                      0
                                      8
                                      105

                                    • How to set up 301 redirect for URL with question mark
                                      Ben_Alvord
                                      Ben_Alvord
                                      0
                                      2
                                      3.6k

                                    • 301 redirect via htaccess question
                                      Audiohype
                                      Audiohype
                                      0
                                      4
                                      404

                                    • 301 Redirect question
                                      webseoservices
                                      webseoservices
                                      0
                                      4
                                      438

                                    • Question about 301 redirect for trailing / ?
                                      YannickVeys
                                      YannickVeys
                                      0
                                      4
                                      524

                                    • Need some help with a tricky 301
                                      ShaMenz
                                      ShaMenz
                                      0
                                      8
                                      524

                                    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