Http/https + www/non-www to https + non-www?

Hi. How to create this redirect in cloudflare Page Rules using only one rule?
http/https + www/non-www to https + non-www?

There is a dedicated tutorial under #Tutorials for that

Redirect www.example.com to example.com

1 Like

That’s nice but I need “http/https + www/non-www to https + non-www”

And how does the tutorial not provide for that?

You can’t do it with one rule. But in real life, enable HSTS for that domain, then add it to the HSTS preload list. Browsers will self-convert http for your domain into https for the connection.

https://hstspreload.org/

If this is due to some page test service complaining about landing page redirects, if you type in the non-canonical URL, of course you’re going to get redirects. Maybe two, depending on how badly you type in the URL. Search engines will get it right if your site is properly configured.

“One page to rule them all, One toggle to bring them all and in encryption bind them”

One page rule should actually be sufficient plus the famous HTTPS toggle of course :wink:

I can’t because I have a subdomain that works with http only

Would you care to explain how the tutorial does not provide what you asked for?

I can’t toggle HTTPS always on because I have a subdomain that works with http only. That’s sad that cloudflare don’t provide subdomain settings…

That is one single use case, in all other cases the rule works just fine. So I really dont know why you claim it doesnt work for you.

As for HTTPS, that can be achieved with a second page rule and either an explicit redirect or “Always use HTTPS” for that rule only.

The problem is that I don’t have free slot for that rule. Okay, anyway, thanks for the help.

You can purchase more rules or simply configure it on your origin.

This topic was automatically closed after 14 days. New replies are no longer allowed.