Cloudflare - Setup www DNS Record and Redirect


Here’s a quick note about setting up my www subdomain within Cloudflare. After setting up the custom domain for Cloudflare Pages I wanted to make the www subdomain point to the root domain.

Nameservers

Because I have placed my domain with an external hoster, I first set up the CloudFlare name servers with the external hoster. After CloudFlare took over the existing DNS records, I deleted the DNS records that still referred to the external hoster.

DNS

  1. Add a new CNAME record
  2. Enter www as the Name
  3. Enter fictionbecomesfact.com as the Target
  4. Leave Proxy status on Proxied and TTL on Auto
  5. Click on Save

Page Rule

  1. Enter as URL: www.fictionbecomesfact.com/*
  2. Enter under Settings:
    • Forwarding URL
    • 302 - Temporary Redirect
    • https://fictionbecomesfact.com/$1
  3. Click on Save and Deploy

I have chosen 302 - Temporary Redirect. When in doubt problaby the best thing is to use 302. Although the www subdomain will always point to the root domain


Read other notes

Comments

    No comments found for this note.

    Join the discussion for this note on this ticket. Comments appear on this page instantly.

    Tags


    Notes mentioning this note


    Notes Graph