Subdomain Redirect: How to Redirect a Subdomain to Any URL

Subdomain Redirect

A subdomain redirect sends visitors who land on a subdomain — like old.example.com — automatically to a different URL, whether that’s another page on your own site or a completely different domain. It’s a common task when retiring an old section of a site, consolidating multiple subdomains, or pointing a memorable subdomain at an external tool like a form, a scheduling page, or a spreadsheet.

The confusing part for most people isn’t the concept — it’s that “redirecting a subdomain” actually involves two separate layers working together: DNS and the redirect rule itself. This guide walks through both, with the exact steps for the most common setup.

What Does It Mean to Redirect a Subdomain?

A subdomain is a prefix added in front of your root domain, such as blog.example.com or shop.example.com. If you’re new to the concept, our guide on what is a subdomain explains it from the ground up.

Redirecting a subdomain means that instead of loading its own content, that subdomain automatically forwards visitors to a different destination. For example:

  • shop.example.com could redirect to example.com/store
  • old-blog.example.com could redirect to a completely different domain, like newblog.com
  • promo.example.com could redirect straight to a specific landing page URL

This is often called subdomain forwarding, and it behaves the same way as a standard page redirect — the browser is told “this content has moved, go here instead” — except it’s applied at the subdomain level rather than to a single page path.

Why People Redirect a Subdomain

  • Consolidating content. Merging a subdomain’s content into the main site to strengthen SEO authority under one domain.
  • Rebranding or migrating. Pointing an old subdomain to a new domain after a rebrand or platform switch.
  • Simplifying links. Using a short, memorable subdomain (like apply.example.com) that redirects to a long third-party URL (like a job application form).
  • Retiring old sections. Sending traffic from a decommissioned subdomain somewhere useful instead of leaving it broken.
  • Preserving SEO value. Using a permanent redirect so any existing backlinks or rankings pointing to the subdomain aren’t wasted.

301 vs. 302: Which Redirect Type Should You Use?

Redirect TypeMeaningWhen to Use It
301 (Permanent)Tells browsers and search engines the move is permanentRetiring a subdomain for good, consolidating content, rebranding
302 (Temporary)Tells browsers and search engines the move is temporaryShort-term campaigns, maintenance, testing a destination before committing

For most subdomain redirect scenarios — especially anything SEO-related — a 301 redirect is the right choice, since it passes along the strongest possible signal that the destination should be treated as the permanent home for that content.

How Subdomain Redirects Actually Work (DNS + Redirect Rule)

This is the part most beginners miss: DNS alone cannot redirect anything. DNS only tells the internet which server to contact for a given hostname — it has no concept of “send this visitor somewhere else instead.” A DNS redirect subdomain to URL setup, despite the common phrasing, always requires two components:

  1. A DNS record (usually a CNAME or A record) that routes the subdomain’s traffic to a server capable of performing the redirect.
  2. A redirect rule or server configuration that actually issues the redirect once traffic arrives.

If you’re using a service like Cloudflare, Cloudflare acts as that middle layer — the DNS record routes traffic through Cloudflare’s network, and a redirect rule tells Cloudflare what to do with it. If you’re managing your own server instead, the redirect rule would live in your web server configuration (such as an .htaccess file on Apache or a server block on Nginx).

How to Redirect a Subdomain to a URL Using Cloudflare

Cloudflare is the most common way people set up a subdomain redirect today, because it handles both the DNS and the redirect rule in one place, without needing to touch server configuration files. Here’s the current, correct method.

Step 1: Make sure the subdomain has a proxied DNS record In your Cloudflare dashboard, go to DNS → Records. If the subdomain you want to redirect doesn’t already have a record, create one:

  • If it doesn’t point to a real server, you can use a CNAME pointing to your root domain, or an A record using the placeholder IP 192.0.2.1 (a non-routable address Cloudflare recommends specifically for redirect-only setups).
  • Make sure the record is set to Proxied (orange cloud) — redirect rules only work on traffic that passes through Cloudflare’s proxy.

Step 2: Go to Rules In the sidebar, open Rules, then select Redirect Rules (this replaced the older “Page Rules” forwarding method, which Cloudflare has moved away from for new setups).

Step 3: Create a new redirect rule Click Create rule, then choose Single Redirect.

Step 4: Set the condition Under the “If” section, set the rule to match the specific subdomain hostname you want to redirect — for example, matching where the hostname equals promo.example.com.

Step 5: Set the destination Choose Static for a fixed destination URL, and enter the full URL you want visitors sent to, including https://.

Step 6: Choose the status code Select 301 for a permanent redirect (or 302 if it’s meant to be temporary).

Step 7: Deploy the rule Save and deploy. The redirect typically becomes active within a minute or two.

Real-World Example

Say you want apply.example.com to redirect visitors straight to a job application form hosted on a third-party platform at https://forms.example-hr.com/careers.

  1. Create a CNAME record for apply pointing to your root domain, set to Proxied
  2. Go to Rules → Redirect Rules → Create rule
  3. Condition: Hostname equals apply.example.com
  4. Destination: https://forms.example-hr.com/careers
  5. Status code: 301
  6. Deploy

Now anyone who visits apply.example.com lands directly on the application form, while you keep a clean, brandable link to share.

Redirecting a Subdomain Without Cloudflare

If your DNS isn’t managed through Cloudflare, you can still redirect a subdomain — the setup just moves to your web server instead:

  • Apache: Point the subdomain’s DNS to your server, then add a Redirect 301 or RewriteRule directive in the relevant virtual host or .htaccess file.
  • Nginx: Point the subdomain’s DNS to your server, then add a server block with a return 301 directive pointing to the destination URL.
  • Hosting control panel: Many hosting providers (cPanel, Plesk, etc.) include a built-in “subdomain forwarding” or “domain redirect” tool that handles both the DNS and redirect without editing config files manually.

Common Mistakes When Redirecting a Subdomain

  • Assuming DNS alone will redirect traffic. A CNAME or A record only routes traffic — it doesn’t forward anyone anywhere without a redirect rule behind it.
  • Leaving the DNS record unproxied in Cloudflare. Redirect Rules require the record to be Proxied; a “DNS only” record bypasses Cloudflare’s redirect engine entirely.
  • Using 302 when the move is permanent. This can dilute SEO value that a 301 would otherwise pass through to the new destination.
  • Redirecting to the wrong protocol. Forgetting https:// in the destination URL can send visitors to an insecure or broken address.
  • Forgetting existing subscribers or bookmarks. If the subdomain had real traffic, a poorly tested redirect can send returning visitors somewhere unexpected — always test the live redirect after deploying it.

Best Practices

  • Use a 301 redirect for anything permanent, especially if the subdomain has existing backlinks or search rankings.
  • Test the redirect in an incognito browser window after deploying, to avoid cached results giving a false read.
  • Keep a record of every subdomain redirect you set up, including why it exists — old, forgotten redirects can become confusing or even a minor security concern over time.
  • If you’re consolidating a subdomain into a subdirectory for SEO reasons, review our comparison of subdomain vs subdirectory first, since that decision affects how much authority the redirect is likely to pass along.
  • Make sure the destination page actually loads correctly and securely — see our SSL subdomain guide if the redirect target also needs certificate coverage.

Frequently Asked Questions

Can I redirect a subdomain using only DNS? No. DNS records route traffic to a server, but they can’t perform a redirect on their own. You always need a redirect rule or server configuration behind the DNS record to actually forward visitors.

How do I redirect a subdomain to a URL in Cloudflare? Create a proxied DNS record for the subdomain, then go to Rules → Redirect Rules, create a rule matching that subdomain’s hostname, set a static destination URL, choose a 301 or 302 status code, and deploy.

What’s the difference between subdomain forwarding and a subdomain redirect? They describe the same outcome — visitors are automatically sent from the subdomain to another destination. “Forwarding” is more commonly used by hosting providers and registrars, while “redirect” is the more general technical term.

Should I use a 301 or 302 redirect for a subdomain? Use a 301 if the change is permanent, since it passes along SEO value to the new destination. Use a 302 only for genuinely temporary situations, such as a short campaign or maintenance period.

Will redirecting a subdomain hurt my SEO? A properly configured 301 redirect generally preserves most of the SEO value associated with the old subdomain. Leaving a subdomain broken or using the wrong redirect type is far more likely to cause SEO issues than the redirect itself.

Can I redirect a subdomain to an entirely different domain? Yes. A subdomain redirect can point to any valid URL, whether it’s a page on your own site, a different domain you own, or a third-party destination like a form or booking page.

Final Thoughts

A subdomain redirect is a simple concept with one detail that trips up almost everyone: DNS gets the traffic to the right place, but the actual redirect always comes from a separate rule — whether that’s Cloudflare’s Redirect Rules, a web server directive, or a hosting control panel tool. Once both pieces are in place, redirecting a subdomain to any URL takes only a few minutes to set up correctly.

If you’re planning a broader restructuring of your site’s subdomains, it’s worth reviewing how to create a subdomain and how domain vs subdomain decisions affect your overall site architecture before making the change permanent.