Redirect www to root


I want to redirect traffic from to
The site is hosted on site-worker.
I want the address in the browser to actually change, otherwise, to my understanding, google might consider it as duplicated content which is bad for SEO.

I managed to get www and the root domain show the same content, but the address in the browser is not changing.

My setup:


Page rules

I’ve followed all instructions in other posts, but wasn’t able to get redirect working with changing the URL in the browser

Thanks for any help

The setup appears to look fine. Which nameservers are mentioned under your DNS records?

Also, the IP addresses you have configured there do not have a valid certificate for your domain, you’d need to fix that too.

Also check if any of your Workers is mapped to “www” (also as wildcard) as that would have precedence over the page rule.

@sandro, You were right, I had another mapping of www to the same worker, and it took precedence over the rule - good catch! Thanks :slight_smile:

Regarding the IP addresses - all my DNS mappings for the different workers use them.
I don’t remember where I got the first worker configuration from, but all the others are just copy-paste from that one.
What do you mean “do not have a valid certificate for your domain” ?
How do I know which IPs I should use?

Thanks again

Do you handle everything on the Worker or do you send anything to these two IP addresses you have configured in your screenshot?

If you handle everything in your Worker you can set the two entries for the naked domain to that 192 address as well. If that’s not the case you’d need to make sure you have a valid certificate on your servers too.

What’s your encryption mode? If it’s not “Full strict” you might have a security issue. Easiest way to check is to fix that setting and check if you get any 52x errors.

@sandro I don’t have any origin server. Everything is handled on the Worker.
If I understand correctly, in this case the IP has no real meaning, is that right?
If so, does it matter if it’s pointing to a real random IP or to 192.x?

Regarding encryption - it is configured to “Full”, not strict.
Considering that I don’t have an origin server, does it matter? I’m not sure I fully understand the difference between full-strict and full.


That is correct.

See my earlier reply.

Generally it should be always “Full strict” as everything else is not secure, but in your case it is not relevant as the connection never leaves Cloudflare.

Both are using TLS but only Full strict verifies the certificate, which means on Full someone could hijack your traffic and present his own certificate.

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