Why it's not redirect with my page rule?

I set up DNS custom domains and page rules. But somehow the redirect rule is not working.
Does anyone know why?

[Goal]
If user access to my website www.example.com, it will redirect to example.com (without www)

[What I’ve done so far]

Setup DNS

  • AAAA - www - 100:: - Proxied
  • CNAME - example.com - example.pages.dev - Proxied

Setup Rules
URL: www.example.com/*
Fowarding URL
301 - Permanent Redirect
destination: https://example.com/$1

Which part is wrong???

Did you add the www name from your Cloudflare Pages configuration first?

Your configuration actually looks all right. Can you post the domain?

Thanks for your reply.

I’ve already have AAAA www 100:: record.
If I add CNAME www record, I got this error.

An A, AAAA, or CNAME record with that host already exists. (Code: 81053)

Now I checked with incognito window and it’s working!!!

(However, normal window is still do not working though…)

Maybe something wrong with my client side.

Thank you!!!

Appears to redirect fine

$ curl -I http://www.techbookrank.com
HTTP/1.1 302 Moved Temporarily
Location: https://techbookrank.com/

Probably a caching issue on your end. Or try a different browser.

2 Likes

Yeah you’re right.

It’s purely caching issue on my client side. Cause it’s working with incognito browser. Thank you!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.