🥳 Celebrate Our Launch With a $200 LIFETIME Discount OFF The Premium Plan Use: BIRTHDAY2024

This offer expires 9/30/2024, at 11:59 PM EST

BizStackPro all-in-one digital marketing platform dashboard.
Redirect Domains in Cloudflare (www ↔ non-www) – BizStackPro Help

BizStackPro Funnels & Websites Help Guide

Redirect Domains in Cloudflare (www ↔ non-www)

Use Cloudflare to redirect either the www or non-www version of your domain to one primary version, then connect that primary domain to your BizStackPro funnel or website.

Quick Answer

How do you redirect www and non-www domains in Cloudflare?

Decide which version will be primary, confirm DNS records exist for both the root domain and www hostname, then create a 301 permanent redirect in Cloudflare that sends the non-primary version to the primary version.

Controlling Which Version of Your Domain Visitors Use

A domain can be accessed through a www version such as www.yourdomain.com or a non-www version such as yourdomain.com.

Cloudflare redirect rules can be used to send one version to the other so visitors consistently reach the primary domain you selected.

Before creating the redirect, both hostnames should exist in DNS. After the redirect is configured, the BizStackPro funnel or website should be attached to the primary domain.

Redirect in One Direction Only

Choose either www or non-www as the primary version and redirect the other version to it. Redirecting both directions can create a redirect loop.

Cloudflare Redirect at a Glance

First Decision Choose www or non-www
DNS Check Root + www
Redirect 301 Permanent
Cloudflare Options Redirect Rules or Page Rules
Final Check Test Both Versions

Before You Begin

Decide which domain version should be the primary address before creating any redirect rule.

  • Choose either www or non-www as the primary version.
  • Confirm DNS entries exist for both the root domain and www.
  • Plan to attach the BizStackPro funnel or website to the primary domain after the redirect is configured.

Step 1: Confirm DNS Records in Cloudflare

Open the Domain in Cloudflare

Log in to Cloudflare and select the domain you want to configure.

Open DNS

Open the DNS section.

Confirm the Root Record

Confirm a DNS record exists for the root domain (@).

Confirm the www Record

Confirm a DNS record also exists for www.

Confirm Both Hostnames Resolve

Make sure both domain versions resolve correctly before creating the redirect rule.

Allow Time After DNS Changes

If you recently changed DNS records, allow propagation time and test again in an incognito window. DNS changes can take up to 24 hours to fully propagate.

Step 2: Create a 301 Redirect Rule

Cloudflare may provide Redirect Rules or the older Page Rules option. Use the method available in your dashboard.

Option A: Redirect Rules

Go to Rules → Redirect Rules, or the available Rules area in Cloudflare, and create a redirect rule.

Option B: Page Rules

Go to Rules → Page Rules and create a Page Rule using a forwarding URL.

Match the Non-Primary Hostname

Set the rule to match the version you want to redirect, such as www.yourdomain.com when the non-www version is primary.

Set the Destination

Set the destination to the primary domain while preserving the path where the rule uses a wildcard.

Example destination: https://yourdomain.com/$1.

Choose 301 Permanent

Use 301 Permanent when standardizing the primary domain.

Save the Rule

Save or deploy the redirect rule.

Page Rules Example

A Page Rule may use a pattern such as https://www.yourdomain.com/* and forward it to https://yourdomain.com/$1, or the reverse when www is your selected primary domain.

301 vs. 302

A 301 redirect is permanent and is the appropriate choice when standardizing a primary domain. A 302 redirect is temporary and should be used only for short-term changes.

Step 3: Test and Troubleshoot

Allow the Rule to Apply

Redirect rules typically apply within minutes.

Open an Incognito Window

Test the redirect in an incognito or private browser window.

Test Both Domain Versions

Try both the root and www versions and confirm the non-primary version redirects to the primary version.

Redirect Does Not Work
Check: Confirm DNS records exist for both root and www.
Check: Verify the rule targets the correct hostname and wildcard path.
Check: Clear browser or DNS cache if needed.
Redirect Loop
Check: Look for conflicting or overlapping redirect rules.
Check: Make sure www is not redirecting to non-www while another rule sends non-www back to www.

Frequently Asked Questions

What should I do if my domain redirect is not working as expected?

Confirm DNS records exist for both root and www. Verify the redirect rule is targeting the correct hostname with a wildcard path. Test in an incognito window, then clear cache if needed. Also check for conflicting rules or redirect loops.

How long does it take for the domain redirect to become active?

Redirect rules typically apply within minutes, but DNS changes can take up to 24 hours to fully propagate. If you recently changed DNS, allow time and retest in incognito.

Can I set up multiple redirects using Cloudflare rules?

Yes. You can create multiple redirect rules as long as they don’t conflict. Keep your rules organized and avoid overlapping patterns that could create loops.

What is the difference between a 301 and 302 redirect, and which one should I use?

A 301 redirect is permanent and is best for SEO when you’re standardizing a primary domain. A 302 redirect is temporary and should be used only for short-term changes.

Continue Learning

Continue with related domain guides for connecting your primary domain to BizStackPro or using BizStackPro’s own URL Redirects setup.

Recommended Next Step

Connect the Primary Domain to Your Funnel or Website

After the redirect is working, make sure the BizStackPro funnel or website is attached to the domain version you selected as the primary address.

Standardize Your Domain

Choose one primary domain version, redirect the other version to it, and connect that primary domain to your BizStackPro funnel or website so visitors reach one consistent destination.

Disclaimer: This site is NOT endorsed by Google, Facebook or YouTube in ANY WAY. All trademarks & Logo / branding are the property of their respective owners. Please Note: This site was created in BizStackPro by Ken George II (An Affiliate of BizStackPro) and may contain affiliate links.

All About BizStackpro


Copyrights 2024 | AllAboutBizStackPro.Com | Pricing | About | Features | All Rights Reserved.