Manage subdomains

Last updated Apr 20, 2026 Once you have added your domain to Cloudflare and updated your nameservers, you also might want to set up a subdomain.

Most subdomains serve a specific purpose within the overall context of your website. For example, blog.example.com might be your blog, support.example.com could be your customer help portal, and store.example.com would be your e-commerce site.

Create a subdomain

If you have already added a subdomain at your host, create a corresponding DNS A or CNAME record for that subdomain (blog, store).

Set up redirects

Redirect a subdomain to the apex domain

Sometimes, you might want all traffic to a subdomain (www.example.com) to actually go to your apex domain (example.com).

  1. Create a proxied DNS A record for your subdomain. This record can point to any IP address since all traffic will be redirected prior to reaching the address.
Type Name IPv4 address Proxy status
A www 192.0.2.1 Proxied
2. Create a Single Redirect to forward traffic from your subdomain to your apex domain.

When incoming requests match

Using the Expression Editor:
(http.request.full_uri contains "www.example.com")

Then

  • Type: Dynamic
  • Expression: concat("https://","example.com",http.request.uri.path)
  • Status code: 301

Redirect the apex domain to a subdomain

Sometimes, you might want all traffic to your apex domain (example.com) to actually go to a subdomain (www.example.com).

  1. If you have already added that subdomain at your host, create a corresponding DNS A or CNAME record for that subdomain.
  2. Create a proxied DNS A record for your apex domain. This record can point to any IP address since all traffic will be redirected prior to reaching the address.
Type Name IPv4 address Proxy status
A @ 192.0.2.1 Proxied
3. Create a Single Redirect to forward traffic from your apex domain to your subdomain.

When incoming requests match

Using the Expression Editor:
(lower(http.host) eq "example.com")

Then

  • Type: Dynamic
  • Expression: concat("https://","www.example.com",http.request.uri.path)
  • Status code: 301

SSL/TLS for subdomains

If your main domain is using Cloudflare's Universal SSL certificate, that certificate also covers all first-level subdomains (blog.example.com).

For deeper subdomains (dev.blog.example.com), use a different type of certificate.

Proxy status

Cloudflare can only serve an SSL/TLS certificate for a DNS record when you set the record's proxy status to Proxied. If you do not do this, the origin server your record points to will be responsible for supporting SSL/TLS connections.

Customize subdomain behavior

If you want to customize Cloudflare settings for individual subdomains, your approach will vary depending on your plan.

Enterprise customers can set up custom settings and access for a specific subdomain within Cloudflare with Subdomain support.

All other customers can set up subdomain-specific Configuration Rules or Page Rules to alter Cloudflare settings.

If you want a subdomain's DNS settings managed totally outside of Cloudflare — meaning this subdomain can be managed by individuals without access to your Cloudflare account — refer to Delegating subdomains outside of Cloudflare.

Was this helpful?

YesNo

On this page

Manage subdomains - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/fundamentals/manage-domains/manage-subdomains/#page","headline":"Manage subdomains","description":"Create subdomains, set up redirects between subdomains and apex domains, and configure SSL/TLS for subdomains on Cloudflare.","url":"https://developers.cloudflare.com/fundamentals/manage-domains/manage-subdomains/","inLanguage":"en","image":"https://developers.cloudflare.com/fundamentals/manage-domains/manage-subdomains/og.png?v=931193c629c6a6c8","dateModified":"2026-04-20","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Learn how to transfer a domain between Cloudflare accounts, including requirements, DNS settings, and SSL/TLS certificate management for seamless migration. title: Move a domain between Cloudflare accounts image: https://developers.cloudflare.com/fundamentals/manage-domains/move-domain/og.png?v=df6f2511f90905ca


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/fundamentals/llms.txt
Use this file to discover all available pages before exploring further.