Uploaded July 2026 | Updated September 2026, 2 weeks ago
In this tutorial, you will learn how to set up a 301 redirect on Cloudflare so that www traffic automatically forwards to your root domain. If your site is live on Cloudflare and you've never set this up, this two minute fix consolidates your SEO authority and prevents Google from seeing two versions of your site.
⭐ Resources Mentioned:
Hostinger VPS (affiliate link):
https://www.hostg.xyz/SHIDN
Use coupon code DISCOUNT7 for an additional 7% off
Shlink (self-hosted URL shortener):
shlink.io
Pretty Links (WordPress plugin):
prettylinks.com
_______________________________
✅ Chapters:
_______________________________
00:00 Intro: About The Tutorial
00:10 The Problem
00:38 WWW & Root Domains
01:07 The Fix
01:24 What is a Canonical URL?
01:58 Pick One (www or root)
02:28 Prerequisites
02:42 Step 1: Open Redirect Rules
03:38 Configure Rules
04:16 Template: www to root
05:05 Request URL
05:28 Wildcard (*)
06:28 Request URL...Target URL
06:51 Target URL
07:17 Status Code: 301 Permanent Redirect
07:25 Preserve Query String
07:54 Save As Draft or Deploy
08:06 Deploy Rule
08:24 Test 301 Redirect
09:38 Bonus Tip: Browser Network Tools
——————⭐ Resources ⭐———————
➜ Gear I Use: mikemurphy.co/resources
➜ Terrapin Textures: terrapintextures.com
➜ Amazon Influencer Store: amazon.com/shop/mikemurphyco
➜ Get Adobe Creative Cloud: mikemurphy.co/adobe
➜ 1Password: 1password.partnerlinks.io/mikemurphy
➜ BeeHiiv Newsletters: https://www.beehiiv.com?via=MikeMurphy1
➜ ElevenLabs: try.elevenlabs.io/kuhb3vjoi7gw
➜ WisprFlow: ref.wisprflow.ai/mike-murphy
——————⭐ Follow Me ⭐———————
➜ Website: mikemurphy.co
➜ YouTube: mikemurphy.co/youtube
➜ X: http://x.com/mikeunplugged
➜ Instagram: instagram.com/mikeunplugged
➜ Podcast: mikemurphy.co/mmu
———————
⚖️ **Amazon Associates Disclosure**
Mike Murphy is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
———————
#cloudflare #301redirect #wwwredirect #seo #canonicaldomain #dns #redirectrules #webdevelopment #domainmanagement #technicalseo #websetup #webhosting #developertools
In this tutorial, you will learn how to set up a 301 redirect on Cloudflare so that www traffic automatically forwards to your root domain. If your site is live on Cloudflare and you've never set this up, this two minute fix consolidates your SEO authority and prevents Google from seeing two versions of your site.
⭐ Resources Mentioned:
Hostinger VPS (affiliate link):
https://www.hostg.xyz/SHIDN
Use coupon code DISCOUNT7 for an additional 7% off
Shlink (self-hosted URL shortener):
shlink.io
Pretty Links (WordPress plugin):
prettylinks.com
_______________________________
✅ Chapters:
_______________________________
00:00 Intro: About The Tutorial
00:10 The Problem
00:38 WWW & Root Domains
01:07 The Fix
01:24 What is a Canonical URL?
01:58 Pick One (www or root)
02:28 Prerequisites
02:42 Step 1: Open Redirect Rules
03:38 Configure Rules
04:16 Template: www to root
05:05 Request URL
05:28 Wildcard (*)
06:28 Request URL...Target URL
06:51 Target URL
07:17 Status Code: 301 Permanent Redirect
07:25 Preserve Query String
07:54 Save As Draft or Deploy
08:06 Deploy Rule
08:24 Test 301 Redirect
09:38 Bonus Tip: Browser Network Tools
——————⭐ Resources ⭐———————
➜ Gear I Use: mikemurphy.co/resources
➜ Terrapin Textures: terrapintextures.com
➜ Amazon Influencer Store: amazon.com/shop/mikemurphyco
➜ Get Adobe Creative Cloud: mikemurphy.co/adobe
➜ 1Password: 1password.partnerlinks.io/mikemurphy
➜ BeeHiiv Newsletters: https://www.beehiiv.com?via=MikeMurphy1
➜ ElevenLabs: try.elevenlabs.io/kuhb3vjoi7gw
➜ WisprFlow: ref.wisprflow.ai/mike-murphy
——————⭐ Follow Me ⭐———————
➜ Website: mikemurphy.co
➜ YouTube: mikemurphy.co/youtube
➜ X: http://x.com/mikeunplugged
➜ Instagram: instagram.com/mikeunplugged
➜ Podcast: mikemurphy.co/mmu
———————
⚖️ **Amazon Associates Disclosure**
Mike Murphy is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
———————
#cloudflare #301redirect #wwwredirect #seo #canonicaldomain #dns #redirectrules #webdevelopment #domainmanagement #technicalseo #websetup #webhosting #developertools










