In https://example.com/blog/cold-brew?ref=email#steps, the path is /blog/cold-brew: everything from the first slash after the host up to a ?, a # or the end of the URL. It names one resource on that server, and it's the part of the address you shape most freely when you build a site. RFC 3986
How a path is built
A path is a series of segments separated by slashes. /blog/cold-brew has two: a folder-like segment, blog, and a page name, cold-brew. The last segment is often called the slug.
The folders don't have to exist. Early web servers mapped a path to a real file on disk; today the server's software usually decides what each path returns. MDN That means you can design paths for people, whatever your CMS does behind the scenes.
What isn't part of the path:
- the domain, which picks the server;
- the query string after
?, which passes parameters; - the fragment identifier after
#, which the browser keeps and never sends to the server.
The URL article shows all the parts side by side.
Path or query string?
Both help the server decide what to return, but they do different jobs:
- The path names the thing.
/shoes/running/is the page about running shoes. - The query adjusts the view.
?sort=pricereorders the same list;?utm_source=newsletteronly tracks a visit.
A useful rule: put content you want indexed in the path, and keep the query for sorting, filtering and tracking. Google recommends trimming parameters that don't change the content, because each combination is another URL to crawl.
Small differences make separate URLs
To Google, each distinct path is a distinct URL. Three details catch people out.
Letter case. The scheme and host aren't case-sensitive, but the path is. Google treats /APPLE and /apple as two URLs with their own content. If your server returns the same page for both, pick one case (usually lowercase), link only to it and redirect the other. Google Search Central
Trailing slashes. /shoes/running/ and /shoes/running are two URLs, and Google treats them separately. The one exception is the root: https://example.com and https://example.com/ are the same, because an empty path means /. If both versions of a page return content, choose one, use it in links and your sitemap, and send the other there with a 301 redirect, or a canonical tag if you can't redirect. Details in trailing slashes.
Encoding. Letters, digits, -, ., _ and ~ can appear as they are. Other characters, including spaces and non-English letters, are percent-encoded, and Google asks for the encoded form in your links: /gem%C3%BCse, not /gemüse. See URL encoding.
Writing good paths
- Use words, not IDs.
/guides/coffee/cold-brewtells people what they'll get;/p/8812doesn't. - Separate words with hyphens. Google recommends hyphens over underscores, because underscores often join words into one concept, as in programming names.
- Pick one spelling per page. One case, one trailing-slash rule, one encoded form, used in every link.
Keep the ranking hopes small. Google says keywords in the URL path alone have hardly any effect beyond appearing in breadcrumbs. Google SEO Starter Guide The real gains are clearer links for people and fewer duplicate URLs. How to group pages in folders, handle parameters and avoid the link patterns that multiply URLs is the job of URL structure.
Should you change an existing path?
Only when the gain is clear, such as removing duplicates or fixing a misleading name. Each change needs a permanent redirect from the old path to the new one, updated internal links and an updated sitemap. A deep folder on its own isn't a good reason; it matters more that the page is well linked from the rest of your site through internal links.