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 Structure Question

    URL Structure Question

    Technical SEO Issues
    4 4 689
    • 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.
    • Malarowski
      Malarowski last edited by

      Hey folks,

      I have a weird problem and currently no idea how to fix it. We have a lot of pages showing up as duplicates although they are the same page, the only difference is the url structure. They seem to show up like:

      http://www.example.com/page/ and http://www.example.com/page

      What would I need to do to force the URLs into one format or the other to avoid having that one page counting as two? The same issue pops up with upper and lower case:

      http://www.example.com/Page and http://www.example.com/page

      Is there any solution to this or would I need to forward them with 301s or similar?

      Thanks,

      Mike

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

        I believe the easiest way would be to add or remove the trailing slash in your .htaccess file in the root directory.

        Make sure you backup your .htaccess file before you edit it!

        The below may work for you but I would guess someone more experience in this area could help more with the coding:

        "

        Use this code to your .htaccess file to remove trailing slashes:

        #get rid of trailing slashes
        RewriteCond %{HTTP_HOST} ^(www.)?turbocelica.lv$ [NC]
        RewriteRule ^(.+)/$ http:/www.example.org/$1 [R=301,L]

        or use this code to ADD trailing slash to the end of each URL:

        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
        RewriteRule (.*)([^/])$ http://www.example.org/$1$2/ [R=301,L]

        "

        MarkLoud 1 Reply Last reply Reply Quote 2
        • MarkLoud
          MarkLoud @RikkiD22 last edited by

          Hey Mike,

          Opt is correct the .htaccess file is the way to go but I would first test this in a sandbox / development environment as messing with this file can bring your entire site down quickly if you get it wrong (and sometimes you think you have it right and there is a knock effect elsewhere).

          Failing that you could always add rel canonical tags to your site which either use the trailing slash format or not. This may be easier to do depending on the CMS you are using.

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

            What happens when you naviaget to these urls,

            [http://www.example.com/page/](http://www.example.com/page/)  and [http://www.example.com/page](http://www.example.com/page)

            do they resolve to one or the other, or do both render the page?

            The answer is to 301 to one or the other, and make sure you are not using both formats in your site.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Just saw a competitor jump in rank by double digits, questioning my url structure choice now.
              Deacyde
              Deacyde
              0
              6
              317

            • Question on URL wording and structure best practices
              solvid
              solvid
              0
              3
              203

            • URL structure
              VERBInteractive
              VERBInteractive
              0
              2
              72

            • Question/Concern about URL structure
              RvG
              RvG
              0
              4
              241

            • Blogger Blog URL Structure Questions
              ChaseH
              ChaseH
              0
              5
              613

            • URL structure
              Gustav-Northclick
              Gustav-Northclick
              0
              10
              809

            • Mobile Domain \ URL Structure SEO questions
              Webmaster_SEO
              Webmaster_SEO
              0
              2
              910

            • URL Structure
              signsny
              signsny
              0
              8
              1.2k

            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