cheshirecat
CDCloudflare Developers
•Created by cheshirecat on 7/2/2023 in #general-help
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!
4 replies