How to Redirect Domains in Cloudflare (for both www and non-www versions)
This guide will walk you through the steps to set up domain redirection within your Cloudflare account, ensuring that both the www and non-www versions of your domain lead to the same page. For this example, we’ll use "thehelpdeskteam.com" and demonstrate how to configure the domain so that "thehelpdeskteam.com" redirects to "www.thehelpdeskteam.com," ensuring a consistent user experience regardless of which version is accessed.
Step 1: Verify Your DNS Records
Log in to your Cloudflare account.
Navigate to the DNS section by selecting the appropriate option from the top menu.
Ensure that you have two CNAME records in place:Root Domain: This should be proxied.
www Version: This should be set to DNS only.
The www version is necessary because it’s registered in Advisor's Growth under Settings > Domains.
Step 2: Create a Permanent Redirect with a Page Rule
Navigate to Page Rules in your Cloudflare dashboard.
Either create a new Page Rule or edit an existing one by clicking the tool icon.
Set up a permanent redirect by choosing Status Code: 301.
In the top field, enter your root domain, ensuring you include /* at the end, like so: https://thehelpdeskteam.com/*. The asterisk acts as a wildcard, covering all subpages.
In the bottom field, input the www version of your domain, followed by /$1, like this: https://www.thehelpdeskteam.com/$1. The $1 retains the path of the redirected page.
Click Save and Deploy to activate the redirect (or simply Save if modifying an existing rule).
Troubleshooting Common Issues
Q1: I keep encountering Funnel Error Code 500 – Failed to execute 'appendChild' on 'Node'. What should I do?
Log in to Cloudflare.
Click on the domain associated with the error.
Navigate to the DNS tab in the left-hand menu.
Select Edit next to the relevant record.
Uncheck the Proxy status option.
Save your changes.
By following these steps, you should be able to set up your domain redirects in Cloudflare seamlessly, ensuring both versions of your domain lead to the same destination.
