Redirect apex to www (301) - CF Pages 2025

For Workers & Pages, what is the name of the domain?

pourfectcocktailscom

What is the error number?

ERR_TOO_MANY_REDIRECTS

What is the error message?

ERR_TOO_MANY_REDIRECTS

What is the issue or error you’re encountering

apex and www are different sites, cant get apex to redirect 301 to www

What steps have you taken to resolve the issue?

Rules → Pages Rules → Redirect from Root to WWW [Template] => results in ERR_TOO_MANY_REDIRECTS
developerscloudflarecom/pages/how-to/www-redirect/ → this but reversed, didn’t work, I got 502 if I remember correctly.

I have tried some other setups but the end result is one of the two scenarios above.

At the moment, both apex and www are pointing to my pages to make sure I dont have any broken links until I find a proper solution for the 301 redirect. Attached DNS records as well.

Basically im looking for a way to get https apex to redirect to https www.

Screenshot of the error

May I ask if both apex (root) domain and www are connected with Pages project or just one of them? :thinking:

I’ve got non-www redirect to www, while www is connected with my Pages project.

If so, please remove both DNS records, disconnect your domain from pages project.
Connect www.pourfectcocktails.com to your Pages.
Upon success, navigate to the DNS tab.
Add new DNS record type A @ (or enter pourfectcocktails.com) pointed to temporary IP address such as 192.0.2.1 and make sure it’s proxied :orange: .

Furthermore, to achieve redirect using Page Rules to redirect non-www (pointed to temporary IP address) to www (connected with Pages):

Otherwise, using Redirect Rule template:

Double-check the SSL/TLS tab and make sure it’s set to Manual (not Automatic) and Full (Strict) option is checked.

Give it some time to apply the changes.
Test using a different Web browser or Incognito Mode (Private Window).

1 Like

Hi Fritex,

Yes I had both of them pointing to the pages.

I’ve tried your suggestions and it’s done the trick. I’ve tried part of your suggestion before, but I didn’t change the SSL encryption, it was set on Flexible and I guess that was messing up with the redirects.

Thank you very much for taking the time to help!

1 Like

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