Cookies disclaimer

I agree Our site saves small pieces of text information (cookies) on your device in order to deliver better content and for statistical purposes. You can disable the usage of cookies by changing the settings of your browser. By browsing our website without changing the browser settings you grant us permission to store that information on your device.

Trailing Slash Duplication

Trailing Slash Duplication


Duplicate Content & Canonicalisation – Trailing Slashes on URLs

Before we get stuck in, lets first have a quick look at what a trailing slash is; a trailing slash is the forward slash ‘/’ that you often see at the end of a URL that has had the file suffix (.html & .php, etc) removed.

There is no special advantage or disadvantage to either having or not having a trailing slash, the problem arises when the site uses them inconsistently.

This article is one of several that fall under the duplicate content and canonicalisation series in the Raptor Knowledge Base. Please the below list for all other articles covering all of the different types of duplicate content and canonicalisation issues that a website can experience below:

Trailing Slashes on URLs

A common issue on sites, especially those that remove the document type suffix (.html .aspx .php) from URL’s is that trailing slashes can be present at the end of a URL. For example:

Impact of Issue

When a web page is accessible from more than one URL, Google may choose to serve either one in the search results unless you specify which to serve. Duplicate content can be devalued by Google and other search engines, which can result in a loss of rankings, ­­ and consequently traffic for terms targeted on those pages.

Hence if a webpage is accessible with and without the trailing slash, this could have a negative impact on your website’s content.

How to Resolve

There are a number of steps that can be taken to ensure that this does not become an issue on your site. The first forces lowercase URLs to be used and the second is a catchall solution for duplicate content.

There is no ‘SEO’ reason to force URL’s to include or not include trailing slashes, it just makes more sense; so just chose which one you prefer.

Raptor Tools!

Use Raptor’s SEO tools to analyse your site to determine if there are any trailing slash duplication issues. Our SEO auditing and web crawler software can easily and quickly identify trailing slash duplication issues.

Redirects (.htaccess)

You will need ‘write / modify’ access to the website’s .htaccess file in order to implement this solution. We always warn people that modifying the .htaccess file can have drastic effects on website functionality if implemented incorrectly. Always test immediately after publishing changes to the file.

Copy the code below into the .htaccess file, save and upload it to the root of the domain overwriting the existing file.

# remove trailing slash
RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L]

Redirects (Windows IIS)

For Windows servers using IIS, you will need to setup a rewrite rule using the code below to remove the trailing slash:

<rule name="Remove trailing slash" stopProcessing="true"> 
  <match url="(.*)/$" /> 
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
  <action type="Redirect" redirectType="Permanent" url="{R:1}" /> 
Use the code below to force the keeping of the trailing slash:
<rule name="Add trailing slash" stopProcessing="true"> 
  <match url="(.*[^/])$" /> 
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
  <action type="Redirect" redirectType="Permanent" url="{R:1}/" /> 

Canonical Tags

This is a topic mentioned in greater detail in another article specific to canonical tags but for the purpose of this article; adding a canonical tag to every page of the site (following the guide above) will prevent most duplicate content issues on any site.

This solution will resolve the issue but will not alow the duplicate page lto rank for the content posted on it. It will however pass on any authority that the page may have to the canonical page.

Benefit of Resolving

Controlling the URL’s from which your site & pages can be accessed prevents the potential impact from duplicate content issues.


30-Day Free Trial of our SEO Web Crawler Now Available, sign up with a valid email address and your name below to get instant access. No Credit Cards Required.