Should I use the final slash or not? What changes?

The question “trailing-slash or not” is asked from time to time, so John Mueller thought about writing something about it in his profile on G +. In this guide he will try to summarize the key concepts and enrich them by going deep into certain explanations.

tl; dr (Too long; didn’t read)

The slash placed after a host name or domain name is irrelevant , you can use it or not when referring to the URL, it ends up being the same thing.

The URLs and have the same value from an indexing point of view.

However, a slash anywhere else represents a significant part of the URL and will change the URL whether it is present or not. This note is not specific to SEO, but refers to how websites work.

How a URL is formed

The W3C standard has defined the composition of the URL, you can find the details in point 5.1 of this page . This section specifies that every request made on a server must contain a Uniform Resource Identifier (URI) and, if you are requesting the homepage, the request matches “/”. Think of relative URLs , using only the slash the homepage is called.

On the other hand, when a sub-folder or a file is requested, a slash too many can create problems with the request, for example by querying the page opens, instead querying with the final slash https : // I’m getting an error message.

These rules must be considered when creating the rel canonical or hreflang tag , a wrong slash can create problems.

Let’s start with the basics

These two URLs typically refer to different entities:

  • (with final slash, it refers by convention to a directory )
  • (without final slash, it refers by convention to a file )

Google is smart you know, it treats each URL separately (and equally) regardless of whether it is a file or a directory or that it contains a trailing slash or that it does not contain a trailing slash.

Different content in URLs ending with and without slash is fine for Google, but not optimal for users. From a search engine technical point of view, it is certainly possible that these two versions of URLs contain different content. Users, however, may find this configuration confusing: just imagine if and generated two separate experiences with different content.

For this reason, URLs with trailing slashes and no trailing slashes often show the same content . The most common case is when a site is configured with a folder structure:


Check the correct configuration of your website

You can do a quick check on your site to see if the URLs:

  • http: // <your-domain> / <folder> / (with trailing slash)
  • http: // <your-domain> / <folder> (no trailing slash)

they don’t both return a response code of 200, but one version redirects to the other. Hope you don’t have 200 status codes on either or they would be considered duplicates if you don’t have a correct canonical rel tag!

  • If you can only return one version (for example, the other redirects to it), that’s great! This behavior is useful because it reduces duplicate content. In the particular case of URL redirects with trailing slashes, Google search results will likely show the version of the URL with response code 200 (most often the trailing slash URL), regardless of whether the redirect is 301 or 302.
  • If both versions with and without trailing slash contain the same content and each returns 200, you can:
    • Consider changing this behavior (more information below) to reduce duplicate content and improve crawl efficiency.
    • Leave it as it is. Many sites have duplicate content. Google’s indexing process often handles this on its own, for webmasters and users alike. While it ‘s not totally optimal behavior , it’s perfectly legitimate.
    • Surely, for the root address (the homepage), with or without slash it does not change. is equivalent to and cannot be redirected, even if you are Chuck Norris.

Avoid a situation with duplicate content on two different URLs:

  • http: // <your-domain> / <folder> / (with trailing slash)
  • http: // <your-domain> / <folder> (no trailing slash)

this means that both URLs return 200 (there is no redirect and neither is the rel canonical tag). The website configuration is dangerous and should be corrected.

  1. Choose a URL as your preferred version . If your site has a directory structure, it is more conventional to use a trailing slash with your directory URLs (e.g. rather than, but you are free to choose which one you prefer.
  2. Be consistent with the preferred version. Use the URL with the preferred version in your internal links . If you have a sitemap, please include the preferred version (and don’t include the duplicate URL).
  3. Use a 301 redirect from duplicate to preferred version. If you can’t use the rel canonical tag use a 301 redirect. The redirect works similar to a canonical for Google’s indexing purposes as well as other major search engines.
  4. Test your setup via Fetch as Googlebot in Webmaster Tools . Make sure your URLs:
    behave as expected. The preferred version should return status code 200. The duplicate URL must go to 301 to the preferred URL.
  5. Check for scan errors in Webmaster Tools and, if possible, web server logs . Verify that the 301s are implemented.

I hope this explanation has clarified your ideas, if you have any doubts or questions leave a comment!

Related posts