Redirect subdomain to external domain

Hi there,

I’m getting tired to do a simple things.
I just switch a TLD to Cloudflare.

Then I used to have a subdomain a.myhost.fr that redirect to anOtherDomain.com (manage by TXT 1|https://anOtherDomain.com)

Since I switched to Cloudflare I can’t find the way to get that redirect working.

I tried :

  • Rules → Redirect Rules (by following this : https://developers.cloudflare.com/rules/url-forwarding/single-redirects/examples/)
  • Bulk Redirect ( by following : https://developers.cloudflare.com/fundamentals/get-started/basic-tasks/manage-domains/redirect-domain/)
  • classic DNS record 1|…
  • Https DNS record

So question is : what is the way to make a simple redirection of a sub domain to an other domain while using Cloudflare ?

Thanks for your help.

2 Likes

I like to create only one :orange: Proxied AAAA record using the discard prefix 100:: for sub.example.com. You can then create a single redirect similar to the following.

Redirect Rule details

When incoming requests match

Field: Hostname
Operator: equals
Value: sub.example.com

Then

Type: Static
URL: https://example.org/
Status code: 301
Preserve query string: :heavy_check_mark:

More examples can be found here:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.