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. Is it better to have trailing slash or no trailing slash in URLs and what if both variations work?

    Is it better to have trailing slash or no trailing slash in URLs and what if both variations work?

    Intermediate & Advanced SEO
    4 4 2.8k
    • 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.
    • urkeman
      urkeman last edited by

      Hi I have a situation on a website where the links are structured like this http://website.com/myurl/ so anywhere you click you will land on a page with a trailing slash but if i remove the trailing slash like this http://website.com/myurl the page is still going to open the same content.

      1. so it works with and without the trailing slash. is this considered as duplicate content by google? and if so what is the best way to go? should i redirect al the non trailing slash urls to trailing slash or the opposite?

      2. if i redirect am i going to loose some link juice from existing external links which mainly already point to urls without th trailing slash.

      3. i've noticed that the sitemap.xml contains links without the trailing slash .. should it contain the urls with the trailing slash?

      Also there's many external links pointing to this site but withouth the trailng slash like this http://website.com/myurl

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

        Hi,

        I would suggest that you verify whether 301 redirects are even a possibility. For example, if the website is hosted on IIS server, then the 301 redirect rule might result into a redirect loop. In such a scenario, I would suggest you place self canonical tag on the page. For example on the page domainA.com/page 1, we will have the following tag in the head section of the page -

        For the PDF files, place the canonical tag in the header response.

        On the links front - You will not be losing a lot 🙂

        Regards,
        Sajeet

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

          I would personally suggest you not to go for 301 as it will increase the page load time of the website which direct affects the rankings in search engines. I would rather prefer to choose the preferred version and use canonicals on every page of the website. This way Google will have an idea about what URL is the preferred and crawl the stuff accordingly.

          Hope this helps!

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

            The problem you're describing is almost exactly the reason why canonical URL functionality exists. Just pick your canonical (with or without slash - it doesn't matter) and make sure you roll it out consistently across your website and sitemap.

            Regards,

            George

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Removing the Trailing Slash in Magento
              effectdigital
              effectdigital
              0
              2
              565

            • How bad is a trailing slash?
              GastonRiera
              GastonRiera
              0
              2
              165

            • Trailing Slash and Non-Trailing Slash Inconsistency
              nerdieb
              nerdieb
              0
              3
              412

            • Which URL is better for SEO?
              HashtagHustler
              HashtagHustler
              0
              6
              154

            • Followup question to rand(om) question: Would two different versions (mobile/desktop) on the same URL work well from an SEO perspective and provide a better overall end-user experience?
              retailgeek
              retailgeek
              0
              2
              202

            • Does having a trailing slash make a url different than the same url without the trailing slash?
              webestate
              webestate
              0
              4
              2.2k

            • Which URL structure is much better?
              cprasad
              cprasad
              0
              3
              362

            • Canonicalization issue? - URLs with and without trailing slashes showing up as unique
              JaredDetroit
              JaredDetroit
              0
              4
              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