Redirect the www to non-www • 2024 without page rules

What is the best way to redirect now in 2024? Using Redirection Rules, ok, but how?
This kind of thing should be a switch, now with these new rules it’s easier to make mistakes.

What about the old sites, will we have to go in 1 by 1 to write the rules again or will it be automatically translated by Cloudflare?

For ease of copying/pasting, the Expression here is: concat("https://example.com", http.request.uri.path)

(Replace example.com obviously.)

3 Likes

Will this redirect corresponding pages … i.e http://www.olddomain.co.uk/about-us to Parked at Loopia us, http://www.olddomain.co.uk/page-about-boilers to Parked at Loopia ?

Can anyone advise how to do this?

Yes.

Follow the directions already provided.

Thank you so much!!

1 Like

The path preservation that you asked about is the http.request.uri.path part of redirect destination URL.

1 Like

Thanks a lot for this post. I could migrate my old “page rules” to the new “redirection rules”.

BTW, is it possible to redirect several forward slashes in the URI to only one?

Enabling Cloudflare normalisation is the easiest way to tidy those up on the way to your origin…

1 Like

Thanks! I have it enabled, however I still see the multiple slashes in the URL, and as I can read, it’s the expected behavior. Surely it’s not a problem, after all.

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