Redirect a subdomain to another URL

To redirect a subdomain such as shop.example.com or blog.example.com to any URL, add the subdomain as the source of a redirect and point it to Redirect Ninja with one CNAME record. Only that subdomain changes: your main domain, its website and its email keep working as they do now.

Common reasons to redirect a subdomain

  • A section moved into the main site. blog.example.com becomes example.com/blog.
  • A tool moved to another provider. shop.example.com or help.example.com now lives at an address on the new provider’s domain.
  • A short, memorable address. book.example.com sends people to your booking page, jobs.example.com to your careers page.
  • A retired subdomain. An old campaign or app subdomain still gets visitors from links and bookmarks, and should lead somewhere useful.

Step 1: Create the redirect

Click Create Redirect, enter the subdomain as the source, for example blog.example.com, and enter the destination. Choose Permanent Redirect (301) if the move is for good, or Temporary Redirect (302) if the subdomain will be used for something else later. 301 or 302?

Several subdomains can go to the same place: add each one as a source of the same redirect.

Step 2: Add a CNAME record for the subdomain

At the DNS provider for your domain, add or change the record for the subdomain’s name:

Host / NameTypeValue
blogCNAMEconnect.redirectninja.com
  • Enter only the subdomain part as the name, such as blog. Most providers add your domain themselves, so blog.example.com would become blog.example.com.example.com.
  • Replace, do not add. If the subdomain already has an A, AAAA or CNAME record, for example pointing at an old blog host, delete it. Leave the records for @ and other names alone.
  • Subdomain also receives email? A CNAME cannot share its name with other records, such as MX. In that case use an A record with the value 75.2.75.160 instead. A record vs CNAME.

Your domain at Cloudflare? Redirect Ninja can create the record for you. The Cloudflare guide.

Step 3: Wait for Verified, then test

The subdomain shows Verified once the record is found, usually within minutes, and its HTTPS certificate is issued straight after. How long it takes. Then enter the subdomain in the redirect checker to see where it lands.

Redirect a subdomain to the main domain, page by page

When a subdomain’s pages moved into the main site with the same paths, one redirect handles all of them. Set the destination to the new section, for example example.com/blog, and turn on Path forwarding. Then blog.example.com/my-post lands on example.com/blog/my-post, which keeps each page’s search rankings. How path forwarding works.

Pages that changed their address get their own source, such as blog.example.com/old-post. Redirecting specific paths.

Good to know

  • Each subdomain is added on its own. Wildcards such as *.example.com are not supported, so add every subdomain you want to redirect as a source.
  • Each subdomain counts as a domain on your bill. The one exception is www: www.example.com and example.com count as one. Path sources on a subdomain are free.
  • “Another account has added this domain too”: create the TXT record the dashboard shows on the main domain. One record covers the domain and all its subdomains.
  • Redirecting the main domain instead? How to redirect a domain to another domain.

Related guides

chat support ninja

Need fast & friendly support?

chat-support

Redirect domains like a ninja

Swift, secure, and effortless — redirect your domains with full HTTPS and ninja precision. Just enter your source and destination, we'll do the rest.