ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข3y agoโ€ข
3 replies
cheshirecat

WWW to Naked Domain with Redirect Rules, preserving Path

Hey all, here's a kind of dumb one, but I'm looking for help with Redirect Rules (single rule).

The structure I'm looking for is, when incoming requests match:
URI Full starts with https://www.domain.com
or
URI Full starts with http://www.domain.com

Then URL redirect to
(effectively) https://domain.com/$path

I tried static with Preserve Query String, but it doesn't look like that's path aware, just query aware.

I think I need a dynamic expression, but I can't find any documentation for that use case and I searched a few pages of discord and same.

The page rule I'm trying to replace was redirect from www.domain.com/* to http://domain.com/$1

Thoughts on the expression I should use?

Thanks!
Website Domain Names, Online Stores & Hosting - Domain.com
Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.
Website Domain Names, Online Stores & Hosting - Domain.com
Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Cloudflare purchased domain + workers + www redirect
Cloudflare DevelopersCDCloudflare Developers / general-help
11mo ago
Redirect Domain assistance, xfer, Rules?
Cloudflare DevelopersCDCloudflare Developers / general-help
6mo ago
WWW Redirect
Cloudflare DevelopersCDCloudflare Developers / general-help
2y ago