Cloudflare
Cloudflare
Cloudflare Redirect Cheatsheet
This guide explains how to set up redirects in Cloudflare to achieve the following:
- Redirect your
*.pages.dev
subdomain to your custom domain. - Redirect
www
to your apex (root) domain.
Steps to Set Up Bulk Redirects in Cloudflare
Go to Bulk Redirects:
- Log in to your Cloudflare dashboard.
- From the main navigation menu, select Bulk Redirects.
Create a New Bulk Redirect List:
- Click Create a new list.
- Add the following redirects:
Redirect from
*.pages.dev
:- Source URL:
cyberthingsde.pages.dev
- Target URL:
https://cyberthings.de
- Enable the following options under “Edit parameters”:
- ✅ Preserve query string
- ✅ Subpath matching
- ✅ Preserve path suffix
- Set the status code to 301 (Permanent Redirect).
- Source URL:
Redirect from
www
to Apex Domain:- Source URL:
www.cyberthings.de
- Target URL:
https://cyberthings.de
- Enable the following options under “Edit parameters”:
- ✅ Preserve query string
- ✅ Subpath matching
- ✅ Preserve path suffix
- Set the status code to 301 (Permanent Redirect).
- Source URL:
Save and Deploy:
- Save the list and create a new Bulk Redirect Rule.
- Assign this list to the rule and activate it.
Below is an example screenshot of how your Bulk Redirect List should look: