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. Technical SEO Issues
    4. URL rewriting causing problems

    URL rewriting causing problems

    Technical SEO Issues
    5 3 535
    • 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.
    • ocelot
      ocelot last edited by

      Hi

      I am having problems with my URL rewriting to create seo friendly / user friendly URL's.  I hope you follow me as I try to explain what is happening...

      Since the creation of my rewrite rule I am getting lots of errors in my SEOMOZ report and Google WMT reports due to duplicate content, titles, description etc

      For example for a product detail, it takes the page and instead of a URL parameter it creates a user friendly url of

      mydomain.com/games-playstation-vita-psp/B0054QAS

      However in the google index there is also the following friendly URL which is the same page - which I would like to remove

      domain.com/games-playstation-vita/B0054QAS

      The key to the rewrite on the above URLs is the /B0054QAS appended at the end - this tells the script which product to load, the details preceeding this could be in effect rubbish

      i.e. domain.com/a-load-of-rubbish/B0054QAS and it would still bring back the same page as above.

      What is the best way of resolving the duplicate URLs that are currently in the google index which is causing problems

      The same issue is causing a quite serious a 5XX error on one of the generated URLs

      http://www.mydomain.com/retailersname/1   -

      , if I click on the link the link does work - it takes you to the retailers site, but again it is the number appended at the end that is the key - the retailersname is just there for user friendly search reasons

      How can I block this or remove it from the results?

      Hope you are still with me and can shed some light on these issues please.

      Many Thanks

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

        To work on the duplicate problem, i think the best option is the cannonical tag. You will need to include in every page (pages you want to be the official one) inside the head tag the follow:

        where ww.example.com/index.html is your page adress.

        Than, to block old pages that you don't want to be at google, you can use the robots.txt file. There you will use the disallow function.

        ocelot 1 Reply Last reply Reply Quote 0
        • ocelot
          ocelot @Naghirniac last edited by

          How would using the canonical tag work though - because I am using URL rewriting?

          For example

          mydomain.com/games-playstation-vita-psp/B0054QAS

          is acutally something like details.php?=B0054QAS - so how would a canonical tag work in a dynamic template like above.

          Because if I placed the tag below in the details.php page then I would need this to change dynamically based on the product - how can this be done?

          http://www.mydomain.com/games-playstation-vita-psp/B0054QAS/>

          Or would a 301 redirect be better to achieve the above?

          Many Thanks

          Dr-Pete 1 Reply Last reply Reply Quote 0
          • Dr-Pete
            Dr-Pete last edited by

            This is really tough to tell from generic examples, because the first thing you need to get at is the root of why these different URLs are being crawled in the first place. If "B0054QAS" is a unique product, why is it reachable by "playstation-vita", "playstation-vita-psp", etc.? That architectural problem has to be solved first, or any canonicalization is just a band-aid.

            1 Reply Last reply Reply Quote 1
            • Dr-Pete
              Dr-Pete @ocelot last edited by

              You can write canonical tags dynamically, but you need to canonical to the product specific page. Obviously, don't canonical every details.php page down to one. It could look something like this:

              $prodDesc = "games-playstation-vita";

              $prodCode = "B0054QAS";

              $prodURL = "http://www.mydomain.com/".prodDesc."/".prodCode;

              ?>

              I assume that the product description and code are generated from a database, so they should be available somehow to the header.

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              • First post
                Last post
              • Problem with regional URL. From regional to international SEO. I need to change the URL
                sara.biowatch
                sara.biowatch
                0
                6
                64

              • Will this URL structure: "domain.com/s/content-title" cause problems?
                0
                2
                42

              • Having Problems to Index all URLs on Sitemap
                Martijn_Scheijbeler
                Martijn_Scheijbeler
                0
                4
                150

              • High DA url rewrite to your url...would it increase the Ranking of a website?
                kayintveen_MD
                kayintveen_MD
                0
                6
                116

              • Duplicate url problem causing me problems
                PaulRonin
                PaulRonin
                0
                6
                246

              • Is it a problem to have a homepage with a slug / URL ?
                NakulGoyal
                NakulGoyal
                0
                3
                3.6k

              • How to find original URLS after Hosting Company added canonical URLs, URL rewrites and duplicate content.
                Nobody1560986989723
                Nobody1560986989723
                0
                2
                366

              • When URL rewrite can lead to un pretty URLs
                RyanOD
                RyanOD
                1
                8
                1.4k

              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