Cloudflare Pages 522 on non-www redirect

I have a site on Cloudflare Pages.

DNS has a CNAME of www > domain.com and one for DOMAIN > domain.pages.dev

domain.com works fine.

www.domain.com ends in a 522 every time.

What am I doing wrong?

Thanks! C

I recommend you redirect ‘www’ with a Page Rule:
Match: www.domain.com/*
Setting: Forwarding URL (301) to https://domain.com/$1

Oooh beautiful - worked a treat! Can I be cheeky and ask if I can fix my trailing slashes issue with page rules too?

You can try, but I don’t think that will get you anywhere. I think that’s come up before with no resolution.

Yeah, still working on it. Without regexes it’s not happening. Thanks for the above tho, appreciate it.

1 Like

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