BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
SEO

Root URL: What it is and how to keep one version

A root URL is a site's top address, such as https://example.com/. With or without the slash it's one URL, but http, https and www versions are not.

Monthly searches · root url
320
Keyword research data
root url
Root URL: What it is and how to keep one version
Click the image to view it full size

The root URL is where a website's addresses begin: the protocol and host name followed by a single slash, with no path, query or fragment after it. Every other page sits below it in the URL's path.

"Root URL" is an everyday term, not one from a standard. The URL standard (RFC 3986) splits an address into parts, and the root URL is what you get when the path is just /:

Part In https://www.example.com/blog/post?id=7
Protocol (scheme) https
Host www.example.com
Path /blog/post
Query id=7
Root URL https://www.example.com/

People sometimes say "root URL" when they mean the homepage, and usually that's the same thing: the homepage is the page a server returns for the root. A few related terms get mixed in:

  • Root domain is the registered domain name without subdomains, such as example.com. www.example.com and shop.example.com are subdomains of it, and each has its own root URL.
  • Root directory is the top folder on the server whose files appear right after the first slash. A file logo.png in it is served at https://example.com/logo.png.

With or without the trailing slash: the same URL

https://example.com and https://example.com/ are the same address. The HTTP standard says an empty path is equivalent to / (RFC 9110), and Google says the two forms of a root URL are equivalent and can't be redirected to each other. Over HTTP/1.1, the request for either one asks the server for /.

That's only true at the root. For deeper pages, /blog and /blog/ are different URLs that can show different content. See trailing slashes.

Two other differences don't matter either: the host is case-insensitive (Example.com is example.com), and the default port (443 for HTTPS) is left out.

The root versions that do count as different

These addresses can all show your homepage, but to a search engine they're separate URLs:

  • http://example.com/ and https://example.com/
  • https://example.com/ and https://www.example.com/
  • https://example.com/ and https://example.com/index.html

If all of them return the page, you have duplicate content at your most important address. Google groups duplicates and picks one to show, but it may not pick the one you want, and split versions make it harder to track how the page performs.

To keep one version:

  1. Choose one. Use HTTPS, then decide with or without www, and keep that choice everywhere.
  2. Redirect the rest. Send every other version to it with a permanent server-side redirect (301 or 308). Google recommends these whenever possible.
  3. Link to it consistently. Use the chosen form in your menus, sitemap, canonical tags and profiles elsewhere.

To check, type each version into a browser and see where you end up. All should land on the same address in one step, without chains. More on choosing a preferred URL in URL canonicalization.

Why the root matters for setup

A few site-wide files and tools work from the root of a host:

  • robots.txt must sit at the root, at https://example.com/robots.txt. A file in a subfolder is ignored. See robots.txt.
  • Sitemaps can list only URLs at or below their own location. A sitemap at the root, such as https://example.com/sitemap.xml, can include any URL on that host; one at /blog/sitemap.xml can include only /blog/ URLs.
  • Google Search Console lets you add a site as a URL-prefix property for one root URL, such as https://www.example.com/, or as a Domain property. A Domain property covers every subdomain and both protocols, and you verify it with a DNS record. If you're unsure which root versions get traffic, a Domain property shows them all.
Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.