How to Redirect a Subdomain to a URL with Cloudflare

For anyone looking to Forward a Subdomain to a URL these are the steps I used as of October 2023. In the example below I will Forward sub.doamin.com to https://google.com

*Note: verify Cloudflare is not paused on your domain. (Overview page, lower right under “Advanced Actions”)

Step1 – Create DNS Record
Type: CNAME
Name: sub
Target: domain.com
Proxy status: Proxied
TTL: Auto

Step2 – Create Redirect Rule
Under “Create new Dynamic Redirect”

For “Rule name” name your rule whatever you would like it named.

If…: Custom filter expression
Field: Hostname
Operator: equals
Value: sub.doamin.com

Then…
Type: Static
URL: https://google.com
Status Code = 301
Check the “Preserve query string” checkbox.