URL Trailing Slash for SEO Purposes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
I noticed when I enter...

http://domain.com/product
and
http://domain.com/product/

they both are treated as a separate page and don't redirect. This is bad SEO practice and is considered duplicate content which Google doesn't like.

For instance on http://www.mattcutts.com/ if you enter either of these

http://www.mattcutts.com/blog/seo-advice-url-canonicalization
http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
http://mattcutts.com/blog/seo-advice-url-canonicalization
http://mattcutts.com/blog/seo-advice-url-canonicalization/

they all redirect to http://www.mattcutts.com/blog/seo-advice-url-canonicalization/

By default Nop gives each of these variations its own page which is seen by search engines as duplicate content.

I understand Nop 3.20 has a fix for the www vs non-www issue, but is there any kind of fix for the trailing slash / vs non-trailing slash at the end of the URLs?
10 years ago
you can do this with a simple IIS Rewrite rule.





<rewrite>
  <rules>
  
    <!--To always remove trailing slash from the URL-->
    <rule name="Remove trailing slash" stopProcessing="true">
      <match url="(.*)/$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="{R:1}" />
    </rule>
    
  </rules>
</rewrite>

10 years ago
marcwagener wrote:
you can do this with a simple IIS Rewrite rule.





<rewrite>
  <rules>
  
    <!--To always remove trailing slash from the URL-->
    <rule name="Remove trailing slash" stopProcessing="true">
      <match url="(.*)/$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="{R:1}" />
    </rule>
    
  </rules>
</rewrite>



Thanks for the quick response Marc! Do you know of an IIS Rewrite Rule that will keep the trailing slash?
10 years ago
this rule can be added in IIS via a template, you have the option to append or to remove trailing slash

I'm removing on my site...
9 years ago
it doesn't affect SEO. Check this video by Matt Cutts http://www.youtube.com/watch?v=CTrdP7lJ2HU
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.