A subdomain is a name placed in front of a domain, separated by a dot, for example blog in blog.example.com. It lets a site owner run a separate section under the same registered domain.
At a glance
- Type
- name left of the domain, separated by a dot
- Affects
- separate host, separate robots.txt
- Used in
- blog, shop, support portal, language versions, staging
- Values
www,blog,shop
Last checked:
How does a subdomain work?
Subdomains are created in the DNS settings of the domain and can point to a different server. Common uses are blogs, support portals, shops, language versions, staging environments or login areas. MDN lists the domain name as part of the URL’s authority, so the subdomain sits in the host part and not in the path.
Subdomain or subdirectory?
blog.example.com subdomain
example.com/blog/ subdirectory
For international sites, Google describes subdomains as easy to set up with flexible server locations, and subdirectories as low maintenance (same host) but limited to a single server location. The pages read do not rank one over the other, and which fits depends on how separate the section is technically and organizationally.
| Structure | Example | Target country recognisable? | Pros according to Google | Cons according to Google |
|---|---|---|---|---|
| Country-code domain (ccTLD) | example. | yes, a strong signal to users and search engines | clear geotargeting, server location irrelevant, easy separation of sites | expensive and sometimes limited availability, more infrastructure, strict ccTLD requirements in some cases, one country only |
| Subdomain on a gTLD (this term) | de. | not always clear from the URL alone (is "de" the language or the country?) | easy to set up, allows different server locations, easy separation of sites | users might not recognise the targeting from the URL alone |
| Subdirectory on a gTLD | example. | not always clear from the URL alone | easy to set up, low maintenance (same host) | users might not recognise the targeting from the URL alone, single server location, harder to separate sites |
| URL parameters | example. | not always clear from the URL alone | – (not recommended by Google) | URL-based segmentation difficult, users might not recognise the targeting from the URL alone |
Generic endings such as .com or .org aren't tied to a country. Google also treats .eu, .asia and some country codes such as .io, .ai, .me or .tv as generic. The country targeting setting in Search Console (International Targeting report) no longer exists. Today, a site on a gTLD is targeted through locale-specific URLs and hreflang (in tags, headers or sitemaps). Google also considers server location and other signals such as local addresses, language and currency. Sources: Google Search Central: Managing multi-regional and multilingual sites (last updated 2025-12-10); Search Console Help: International Targeting report (deprecated). Last checked: .
When does it matter in a migration?
Google says a Change of Address submission in Search Console applies when switching domains or subdomains. Redirects should be permanent (301 or 308) and stay active for at least a year.
Subdomains can be nested as well, as in eu.shop.example.com. Wildcard records (*.example.com) can route many subdomain names to one server (Themeisle).
Example
https://www.example.com/ main site
https://shop.example.com/ shop on a subdomain
https://support.example.com/ help center
Common mistakes
- No separate robots.txt. Rules in a robots.txt apply only to the host where the file is posted, according to Google’s documentation. A subdomain does not inherit the file of the main domain.
- Move without redirects. When URLs change, for example from a subdomain to a subdirectory, Google advises permanent server-side redirects from the old to the new URLs.
Sources
- Managing multi-regional and multilingual sites – Google Search Centraldevelopers.google.com
- What is a URL? – MDN Web Docsdeveloper.mozilla.org
- Site moves with URL changes – Google Search Centraldevelopers.google.com
- What Are Subdomains? – Themeisle (secondary)themeisle.com
- robots.txt specifications – Google Search Centraldevelopers.google.com
Last updated: