Cloudflare and redirects - expected URLs and if a double hop even needs to be fixed

I’m having an issue with Cloudflare and 2 redirects to my wordpress site emeraldoceanpublishing.com - when I test with cloudflare it gives me the message:

The page may not be loading as expected because your test URL (https://emeraldoceanpublishing.com/) was redirected to https://www.emeraldoceanpublishing.com/. Try testing the second URL directly.

In short, it redirects from
http://emeraldoceanpublishing.com
to
https://emeraldoceanpublishing.com
to
https://emeraldoceanpublishing.com

As I understand it’s not a bad thing, though it does add 2 seconds to the loading time. If it’s that (i.e. normal with wordpress) I’m just wondering why my other wordpress sites (also using cloudflare) don’t have the double hop.

I’ve seen this question posted many times (about redirects), but my concern is why Cloudflare is giving me that message, and if it’s something I’ve misconfigured most likely or not.

Any help would be great!

Your redirects aren’t quite what you say they are.

The first redirect is http->https, done on Cloudflare.
The second redirect is your domain to www, done on your Wordpress install (that’s the slow one).
https://cf.sjr.org.uk/tools/check?b63a9ef9d7b44294a20ae600de1497e6#connection-worker-http

You can speed things up by doing to the domain->www redirect on Cloudflare which will combine those two into one and execute the redirect close to the user without having to reach your server.

1 Like

Thank you so much! Just to be clear (because obviously I’m not as good as this as you!), I’m creating a page rule that would take the URL

http://emeraldoceanpublishing.com/

forward it to

https://www.emeraldoceanpublishing.com/$2

On a permanent 301 redirect.

Change http://emeraldoceanpublishing.com/ to emeraldoceanpublishing.com/* (so it matches for http and https)
Change https://www.emeraldoceanpublishing.com/$2 to https://www.emeraldoceanpublishing.com/$1 (the $1 matches the first *)

1 Like

Perfect!!! Thank you very much!

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