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. Multiple 301 Redirects on the same domain name

    Multiple 301 Redirects on the same domain name

    Intermediate & Advanced SEO
    3 2 357
    • 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.
    • AmyCrompton
      AmyCrompton last edited by

      Hi,

      I'd appreciate some advice ont he below.

      I have a website, say www.site.co.uk that has just been redesigned using a new CMS. Previously it had URLs in the format /article.php?id=123, the new site has more friendly urls in the format /articles/article-slug.

      I have been able to import the old articles into my CMS using the same article IDs and I have created a unique slug for each post. So now in my database, I have the article id (from the querystring) and a slug.

      However, I have hundreds of old URLs indexed by Google in the format /article.php?id=123 and need to redirect these.

      My plan was to do the following. 301 Redirect /article.php?id=123 to an intermediate page, in this case /redirect/123. On this intermediate page I would do a database lookup for the article slug, based on the ID from the querystring, create a new URL and perform a second 301 redirect to my new URL E.g. /articles/article-slug-from-database.

      Whilst this works and keeps the site usable for visitors the two 301 redirects do worry me, as I don;t want Google indexing lots of /redirect/[article id] urls.

      The other solution is to generate hundreds of htaccess redirect rules that map old url to the new url. The first solution is much cleaner, but the two 301's worry me. Will Google work this out on it's own, is there a better way?

      Any advice is much appreciated.

      Cheers

      Rob

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

        Hi Rob,

        I do not recommend the second option (using htaccess)   it's a worse abuse of Apache than described above as it would have to do that for every file request (gif|html|js|css|etc)

        So my solution for you is to httpd.conf and RewriteMap either by using prg: map or txt: map.

        my recommendation will of course be prg: map where you can query your database

        For your help http://httpd.apache.org/docs/current/rewrite/rewritemap.html

        Cheers!

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

          Great call, I hadn't thought of that. Will go that a go definitly. Cheers

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Domain Name redirection to new Domain Name - VS - Transfering Domaine Name from account 1 to account 2
            1
            1
            38

          • Possible issues with 301 redirecting to a new domain name
            benesmartin
            benesmartin
            0
            2
            35

          • Have You 301 Redirected Domain A to Domain B ?
            Nayotanguyen
            Nayotanguyen
            0
            13
            491

          • Handling Multiple Domain 301 Redirects on Single htaccess file
            Andy.Drinkwater
            Andy.Drinkwater
            0
            2
            291

          • 301 redirect to multiple domain
            StevePatenaude
            StevePatenaude
            0
            6
            146

          • Aged domain and 301 redirect? (11 year old domain)
            RCDesign74
            RCDesign74
            0
            5
            2.0k

          • 301 Redirecting multiple domains to brand new domain
            SEODinosaur
            SEODinosaur
            0
            13
            1.7k

          • Multiple 301 redirects considered a redirection chain?
            jmueller
            jmueller
            1
            16
            5.0k

          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