To slash or not to slash

Wednesday, April 21, 2010

That is the question we hear often. Onward to the answers! Historically, it's common for URLs with a trailing slash to indicate a directory, and those without a trailing slash to denote a file: (with trailing slash, conventionally a directory) (without trailing slash, conventionally a file)

But they certainly don't have to. Google treats each URL above separately (and equally) regardless of whether it's a file or a directory, or it contains a trailing slash or it doesn't contain a trailing slash.

Different content on slash and non-slash URLs is okay for Google, but often is less ideal for users

From a technical, search engine standpoint, it's certainly permissible for these two URL versions to contain different content. Your users, however, may find this configuration horribly confusing—just imagine if and produced two separate experiences.

For this reason, trailing slash and non-trailing slash URLs often serve the same content. The most common case is when a site is configured with a directory structure:

Your site's configuration and your options

You can do a quick check on your site to see if either of the URLs matching this pattern redirects to the other:

    (with trailing slash)
    (no trailing slash)
  • If only one version can be returned (that is, the other redirects to it), that's great! This behavior is beneficial because it reduces