Deutsch
URLs & domains

Subdirectory

Also known as: subfolder, folder

A subdirectory (also called a subfolder) is a section of a website that sits in the path of the same domain, for example example.com/blog/. For SEO, the term describes how a site is organized in its URLs.

At a glance

Type
path segment of a URL on the same domain
Affects
URL structure, same host as the main domain
Used in
blog, shop, help center, language versions
Values
/blog/, /de/

Last checked:

How does a subdirectory differ from a subdomain?

A subdirectory belongs to the path after the domain. A subdomain comes before the domain name, as in blog.example.com.

Code
example.com/blog/   subdirectory
blog.example.com    subdomain

Because a subdirectory stays under the main host, it is typically served from the same server setup and under the same domain as the rest of the site.

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 does Google say?

For multi-regional and multilingual sites, Google lists URL structures side by side. Subdirectories with a generic domain (example.com/de/) are listed as easy to set up and low maintenance (same host), with the drawbacks of a single server location and harder separation of sites. Subdomains (de.example.com) are listed as easy to set up, allowing different server locations and easy separation of sites. Google says nothing in that guidance about ranking one structure above the other. Whichever you choose, each language version needs its own URL.

Subdirectories can nest, as in example.com/blog/seo/. Each level is another segment of the path, and the path of a URL is only a naming scheme. It does not have to match folders on the server.

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 gTLDde.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 gTLD (this term)example.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: .

Example

A site serves German and French content under these paths:

Code
https://example.com/de/
https://example.com/fr/

Each language lives in its own subdirectory, and hreflang annotations connect the equivalent pages.

Common mistakes

  • Move between subdomain and subdirectory without redirects. Changing URLs is a site move with URL changes. Google advises permanent server-side redirects from old to new URLs.
  • Language versions without hreflang. For multilingual sites, Google asks that each language version is marked clearly, for example with hreflang annotations.

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

Last updated: