Deutsch
URLs & domains

Trailing slash

Also known as: final slash

A trailing slash is the forward slash at the end of a URL, as in https://example.com/foo/. Historically, a trailing slash marked a directory and a URL without it marked a file.

How does Google treat a trailing slash?

According to Google, the convention does not have to hold. Google treats https://example.com/foo/ and https://example.com/foo as separate URLs, whether they are files or directories. It accepts different content on both, though users may find that confusing. In practice, both versions usually serve the same content.

The root URL is an exception. https://example.com and https://example.com/ are equivalent.

Anatomy of a URLThe example URL https://shop.example.de/shoes/sneakers/?color=red&page=2#reviews broken into parts: scheme https, host shop.example.de with subdomain shop, domain example.de and top-level domain de, path /shoes/sneakers/ with a trailing slash, query string with two parameters color=red and page=2, fragment reviews. The fragment is not sent to the server.Trailing slashhttps://shop.example.de/shoes/sneakers/?color=red&page=2#reviewsSchemeHostPathQuery stringFragmentSubdomainDomainParameterParameterTLDcountry code: ccTLDstays in the browser, is notsent to the serverSchematic. Scheme, host, path, query and fragment are components defined in RFC 3986.Subdomain, domain and TLD split the host by DNS level. Without a port, https uses port 443.
A URL broken into its parts. RFC 3986 defines scheme, host, path, query and fragment. Only the browser evaluates the fragment after #, it is not sent to the server. Sources: RFC 3986: Uniform Resource Identifier (URI), Generic Syntax; MDN: What is a URL?; MDN Glossary: TLD.

What if both versions return 200?

If both versions return the same content with a 200 status, Google calls this legitimate, because its indexing often handles the situation. It still lists two options, which are leaving it as is or serving only one version. A redirect from one version to the other reduces duplicate content and improves crawl efficiency. Google’s current documentation on canonicalization still lists redirects and rel="canonical" as strong signals and sitemap inclusion as a weak one. Google’s blog notes that when a page redirects to a trailing slash URL, search results will likely show the version that returns 200, regardless of 301 or 302.

Ahrefs adds that canonical tags, internal links and sitemaps should consistently point to the preferred version.

Example

Text
https://example.com/guides/   (redirects with 301 to the version below)
https://example.com/guides

Pick one pattern for the whole site, redirect the other to it, and use the same form in internal links and canonical tags.

Sources

  1. To slash or not to slash – Google Search Central Blog (April 21, 2010)developers.google.com
  2. Trailing slash – Ahrefs (secondary)ahrefs.com
  3. Consolidate duplicate URLs – Google Search Central (as of October 2026)developers.google.com

Last updated: