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

    Canonicalization issue? - URLs with and without trailing slashes showing up as unique

    Intermediate & Advanced SEO
    4 2 1.2k
    • 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.
    • ApprendaPlatform
      ApprendaPlatform last edited by

      For some reason, our urls are set to change from “www.apprenda.com/ANYTHING" to “apprenda.com/ANYTHING”

      These register as different pages though?  We have rankings in SEOMoz Pro for terms where our homepage shows up 6th on google, but SEOMoz says it's not on the first page because it's checking against apprenda.com and not www.apprenda.com

      Also, it seems like for some reason pages with trailing slashes also register differently than those without. Should we be doing something for that? Something to make sure all pages get rewritten to having the trailing slash or not?

      For instance, this url: http://apprenda.com/saasgrid/features/multi-tenancy/ and this url” http://apprenda.com/saasgrid/features/multi-tenancy are really the same page.  Yet in our analytics, they register as different pages with their own stats, etc.

      What should we do in our particular case, and how can we get this fixed?

      I really appreciate the help, and thanks in advance!

      • Jesse
      1 Reply Last reply Reply Quote 0
      • JaredDetroit
        JaredDetroit last edited by

        You should utilize htaccess 301 permanent redirects to force trailing slashes and www. to your URLs (or vice versa). This way you will let Google and other search engines know the correct way to be displaying your URLs. Anything pointing to your domain that doesn't fit that will be redirected to the proper format. This, as well as utilizing canonical tags, should take care of your duplicate content issue.

        I'm assuming you have an index.php for your website but modify this and test as needed.

        Externally redirect to add missing trailing slash to URLs with no filetype

        RewriteCond $1 !(.[a-z0-9]{1,5}|/)$ [NC]
        RewriteRule ^(.*)$ http://www.mywebsite.com/$1/ [R=301,L]

        Externally redirect non-blank non-canonical hostname request to canonical hostname

        (if not already done by the above rule)

        RewriteCond %{HTTP_HOST} !^(www.mysite.com)?$
        RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]

        Rewrite all requests which do not resolve to existing files to the CMS script, except

        for image, css, and JS file requests, none of which need to be handled by the CMS,

        and requests for index.php itself (to avoid a wasteful second-pass exists check).

        RewriteCond $1 !(^index.php|.(gif|jpe?g|png|css|js))$
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]

        Make sure you test this out before going live but it should work for what you need.

        ApprendaPlatform 1 Reply Last reply Reply Quote 0
        • ApprendaPlatform
          ApprendaPlatform @JaredDetroit last edited by

          Awesome, thanks Jared!  Our site is .NET based, but I believe their is a standard "index.aspx".  Would this still apply?

          Also, you mentioned that this, AS WELL AS utilizing canonical tags should take care of this.  How should we go about utilizing canonical tags for our site?

          Thanks again!

          • Jesse
          JaredDetroit 1 Reply Last reply Reply Quote 0
          • JaredDetroit
            JaredDetroit @ApprendaPlatform last edited by

            Here's a good post (here at SEOmoz) about the rel=canonical tag: http://www.seomoz.org/blog/complete-guide-to-rel-canonical-how-to-and-why-not

            Here is a good resource for 301 redirects in other languages: http://www.webconfs.com/how-to-redirect-a-webpage.php

            I don't have much experience with .NET but it looks like there are two ways to accomplish it. 1) Make changes to IIS to create the permanent redirect, 2) create server side code (maybe you have to check what URL is being requested and redirect them to the correct format?). You should be able to use REGEX like is displayed in my original post to accomplish this in .NET.

            I would say the change directly in IIS, if you have access, is the way to go.

            Jared

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Does having active urls with and without trailing .html impact SEO?
              effectdigital
              effectdigital
              0
              2
              269

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

            • Trailing Slashes on URLs
              WebElaine
              WebElaine
              0
              2
              2.3k

            • Duplicate content on URL trailing slash
              BlueprintMarketing
              BlueprintMarketing
              1
              6
              7.4k

            • To slash or not to slash - Going from no trailing slashes to trailing slashes sitewide
              justin-brock
              justin-brock
              0
              2
              135

            • Site Redesign Inconsistent Trailing Slash Issue
              davebuts
              davebuts
              0
              2
              113

            • Magento Trailing Slash URL Problem
              MozAddict
              MozAddict
              0
              8
              8.5k

            • Infinite Redirect Loop without trailing slash, please help
              debc
              debc
              0
              11
              2.5k

            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