Redirect the www to non-www

I need some help here the client’s domain is on GoDaddy, and it’s pointing to Cloudflare DNS. I’m trying to redirect the www to non-www any insight would be very helpful?

Hi @clickuplocal

To redirect www to non-www through Cloudflare, you’ll need to set up a page rule do this,

  1. Visit the Cloudflare dashboard and select your domain.
  2. Click on the ‘Page Rules’ tab.
  3. Click on ‘Create Page Rule’.
  4. In the ‘If the URL matches’ field, input www.yourdomain.com/*.
  5. Select ‘Forwarding URL’ under ‘Then the settings are’, and choose a 301 (Permanent Redirect) status.
  6. In the ‘Enter destination URL’ field, input https://yourdomain.com/$1.
  7. Click ‘Save and Deploy’ to create the rule.

The www part of the domain will now be automatically redirected to the non-www version.

The screen shots are a bit old, but you can see what this looks like if you click Archive on this older Tutorial Deprecated - Redirect www.example.com to example.com

4 Likes

You’re a hero thank you so much.

2 Likes

:partying_face: happily. Thank you for confirming.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.