How to Redirect www to Your Root Domain Using Cloudflare

Video:

Coming soon...

Article:

If you're using Cloudflare with your Convertri domain, you may notice that your root domain (for example, example.com) works correctly, but the www version (www.example.com) returns a 404 page.

This happens because Cloudflare acts as a proxy between your visitors and your website. When Cloudflare's proxy (the orange cloud) is enabled, Convertri cannot automatically redirect www to your root domain. Instead, the redirect must be configured within Cloudflare.

If your domain is using Cloudflare, follow the steps below to create a redirect from www.example.com to example.com.

Note: These instructions only apply if your domain is using Cloudflare.

If you see this warning in Convertri

If your domain is configured with Cloudflare, you may see the following warning in your Domains list:

This warning indicates that your domain is using Cloudflare's proxy service (the orange cloud). While this setup is supported, redirects from www to your root domain must be configured directly in Cloudflare, as described below.





Step 1: Verify Your DNS Record

  1. Sign in to your Cloudflare account and select your domain.
  2. Go to DNSRecords.
  3. Locate the www record.
  4. Confirm that:
    • A www A or CNAME record exists.
    • The Proxy status is Proxied (orange cloud).

Important: Cloudflare Redirect Rules only work on proxied hostnames.




Step 2: Create the Redirect Rule

  1. In Cloudflare, go to RulesOverview.
  2. Select Templates.
  3. Find the Redirect from WWW to root template.
  4. Select the template to review the pre-filled settings.

The template should use the following values:

Setting

Value

Request URL https://www.*
Target URL https://${1}
Status Code 301
Preserve Query String Enabled

These settings preserve the page path and query string. For example:

https://www.example.com/products/?id=5

becomes

https://example.com/products/?id=5

  1. Select Deploy.



Step 3: Enable HTTPS

Next, verify your SSL settings.

  1. Go to SSL/TLSOverview.
  2. Make sure the SSL/TLS encryption mode is not set to Off.
  3. Go to SSL/TLSEdge Certificates.
  4. Enable Always Use HTTPS.



Step 4: Test the Redirect

After saving your changes, test both of the following URLs:

  • http://www.example.com/page
  • https://www.example.com/page

The expected behavior is:

  • The HTTP version redirects to HTTPS.
  • Cloudflare then redirects the request to:
    • https://example.com/page

Because of this, visiting the HTTP version will use two redirects, which is expected.




Verify the Redirect

Some browsers hide https:// and www in the address bar.

To verify the final URL:

  • Right-click the address bar and select Copy.
  • Paste the copied address into a text editor or email.

Alternatively:

  • Mac: Press Command + L, then Command + C
  • Windows/Linux: Press Ctrl + L, then Ctrl + C

The copied URL should begin with:

https://example.com/

and should not include www.




Important

Do not configure an opposite redirect (example.com → www.example.com) in either Cloudflare or Convertri. Having redirects in both directions can create a redirect loop, preventing your website from loading properly.




Why does this happen?

Cloudflare's proxy service sits between your visitors and your website. Because of this, Convertri cannot control redirects for proxied domains. Redirects from www to your root domain must be configured directly within Cloudflare using a Redirect Rule.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.