Deutsch

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.

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.

Subdomain or subdirectory?

Code
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.

URL structures for country versions compared
StructureExampleTarget country recognisable?Pros according to GoogleCons according to Google
Country-code domain (ccTLD)example.deyes, a strong signal to users and search enginesclear geotargeting, server location irrelevant, easy separation of sitesexpensive and sometimes limited availability, more infrastructure, strict ccTLD requirements in some cases, one country only
Subdomain on a gTLD (this term)de.example.comnot always clear from the URL alone (is "de" the language or the country?)easy to set up, allows different server locations, easy separation of sitesusers might not recognise the targeting from the URL alone
Subdirectory on a gTLDexample.com/de/not always clear from the URL aloneeasy 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 parametersexample.com?loc=denot 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

Code
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

  1. Managing multi-regional and multilingual sites – Google Search Centraldevelopers.google.com
  2. What is a URL? – MDN Web Docsdeveloper.mozilla.org
  3. Site moves with URL changes – Google Search Centraldevelopers.google.com
  4. What Are Subdomains? – Themeisle (secondary)themeisle.com
  5. robots.txt specifications – Google Search Centraldevelopers.google.com

Last updated: