This tutorial will show you how to redirect all of your WWW domain traffic to your non-WWW (naked) domain using a Cloudflare Page Rule.

Example: 301 redirect -->

Once you've navigate to the Rules Tab, click Create Page Rule. Cloudflare Rules Page

Set the URL Match Value to your WWW Domain

For we would set the URL Match value to*: Cloudflare Url Match Textbox

Add a Forwarding URL Rule to the Settings

  • From the Pick a Setting dropdown, select Forwarding URL

  • Then set the Select status code dropdown to 301 - Permanent Redirect

  • Next set the Ender destination URL to$1 Cloudflare Rules 301 Redirect Settings

Click 'Save and Deploy' and Test the New Page Rule

Click Save and Deploy and your rule should be in place.

Now let's test that your WWW subdomain redirects to your non-WWW domain (naked domain) at

  • Open up your favorite web browser and open the developer tools (I'm using Chrome).

  • Type your WWW domain, into your navigation bar.

  • You should see the 301 redirect in the Network tab of your developer tools:

Cloudflare Rules 301 Redirect Works Properly

Still Stuck?

If you are still having trouble feel free reach out to me on Twitter or check out the additional resources below.

Additional Resources

Understanding and Configuring Cloudflare Page Rules (Page Rules Tutorial)

FeedbackI'd love to hear your feedback!
Did this blog post help fix your issue? Still having trouble?
Tweet At Me
Brendan SlukeSoftware Engineer

Hi, I'm Brendan Sluke and I love writing code and blogging about software engineering.

Follow Me On Twitter Read My Blog
Recommended Blog PostsBlog Posts I Think You Will Find Interesting
Go Back To Top of Page