Redirect Your Domain to www (Cloudflare Redirect Rules)
Example: send yourrescue.org directly to www.yourrescue.org, keeping the path and query string.
This redirect happens before your website loads.
Visitors who type or bookmark your domain without www still land on the right page.
Quick Path
- Confirm you can log in to Cloudflare and open your domain.
- Create a CNAME record for @ pointing to www, and make sure it is proxied.
- Add a Redirect Rule so yourrescue.org redirects to www.yourrescue.org (301, path preserved).
- Test in a private/incognito window.
Step 1 β Confirm you can manage the domain in Cloudflare
This step makes sure you have the right access before you start.
If you cannot see the domain, you cannot set up the redirect.
- Log in to Cloudflare dashboard.
- Open the account that owns the domain.
- Click the domain you want to configure.
- If you do not have access, start with Cloudflare Account Setup.
You can open the domain settings in Cloudflare.
You can access DNS and Rules for the domain.
Step 2 β Point your domain without www to www in DNS
This step creates the DNS record the Redirect Rule needs to match.
For the example, you are pointing `yourrescue.org` (no www) at `www.yourrescue.org`.
- Go to DNS for your domain.
- Create (or edit) the record for @ (your domain without www).
- Type: CNAME, pointing to www (or your www hostname).
- Make sure the record is proxied (orange cloud) β Redirect Rules only work on proxied traffic.
- Save the DNS record.
`yourrescue.org` has a proxied CNAME record pointing at `www.yourrescue.org`.
Cloudflare can now apply a Redirect Rule to it.
Step 3 β Add a Redirect Rule to send visitors to www
This step makes Cloudflare redirect visitors from your domain without www to your www domain.
It is a clean, no-JavaScript redirect that works for browsers and search engines, and it keeps the page path and query string.
- In Cloudflare, open Rules β Redirect Rules.
- Select Create rule β Redirect Rule.
- Under When incoming requests match, choose Wildcard pattern and enter http*://yourrescue.org/* (replace the domain).
- Under Then, set the target URL to dynamic: https://www.yourrescue.org/${1}.
- Status code: 301 (Permanent).
- Turn on Preserve query string.
- Select Deploy.
Cloudflare shows the Redirect Rule as deployed.
Any visit to `yourrescue.org/anything` redirects to `www.yourrescue.org/anything`, keeping the path and any `?query=string`.
Step 4 β Test the redirect
This step confirms it works for real visitors.
Testing in a private window avoids cached results.
- Open a private/incognito browser window.
- Go to `https://yourrescue.org`.
- Confirm you land on `https://www.yourrescue.org`.
- Go to `https://yourrescue.org/about` (or any real page) and confirm the path carries over to www.
The redirect happens immediately.
Your website loads normally on www, and the path/query string are preserved.
Official References
Open these only if something doesnβt match your screen.
You do not need to read them to complete the guide.
Related How-To Sessions
How to Create Your Organization's Cloudflare Account
Get access to your domain and DNS in Cloudflare.
How to Transfer a Domain to Cloudflare
Move your domain registration to Cloudflare when you're ready.
Publish Your Website with Cloudflare Pages + GitHub
How the site is deployed and connected to your domain.
Want 4leggedIT to Set This Up?
Send us the domain you want redirected (example: yourrescue.org β www.yourrescue.org), and weβll configure the redirect safely.
