Http:// redirects to https:// then https:www

Hello. I have read many threads on this topic, but have not found the answer to my situation. I am currently using Cloudflare Flexible SSL with Always use HTTPS and Automatic HTTPS rewrites on. I also have the following Page Rule - http://www.wallpapergeeks.com/ Always Use HTTPS.

No problem with http://www redirecting to https://www or
https:// redirecting to https://www.
However, http:// redirects to https:// then to https://www.
How can I make http:// redirect to https://www so there is only one redirect?

Thanks for your time!

1 Like

Thanks for the straight feedback.Can I leave cloudflare flexible SSL on while I install an SSL certificate on my server? After I set the SSL to full, should I keep the other settings to achieve only one redirection to https://www.mysite.com.
(Always use HTTPS, Automatic HTTPS rewrites on, and Page Rule - http://www.mysite.com/ Always Use HTTPS) Are there any other settings I should use with Full SSL?

Flexible is fine as a temp solution. You should use Full (Strict) after installing a valid certificate at your origin.

To eliminate the double redirect, the page rule for URL http://example.com/* should not have the setting Always Use HTTPS. Instead, replace it with the following setting:

Forwarding URL
Status code: 301
Destination URL: https://www.example.com/$1

Thanks for the suggestion florapare. I tried that, but it did not work. Does it make a difference whether I use http://www.example.com/* or http://www.example.com/

Redirects are cached. Make sure you purge your cache for the URLs after implementing the page rule.

A * between http:// and www should have no effect here, unless you have other www subdomains, such as 2www, 3www, etc.

BTW, you can use the </> code icon to format your URLs so that * aren’t changed to italics.

I did purge the cache, but no luck. It slowed down my site so I am changing it back, but thanks so much for the idea!

1 Like

Sorry, it should be from naked domain to www, but I wrote the example the other way around. Please see the edited post above.

Also, after purging the relevant URLs, make sure you visit the page with incognito mode, as browsers also cache redirects.

You seem to have fixed the certificate issue now, haven’t you?

Don’t forget to change to “Full strict” now.

1 Like

The issue still remains, but I will take sdayman’s advice and instal an SSL certificate on my server. My only draw back is my concern it mat slow down my site.

BTW, when I used the naked domain I got a 404.

Hello,

Before the thread closes, I had a thought. Could I use 2 page rules to temporarily clear up the issue?
Perhaps…
http://www.example.com/ Always Use HTTPS
and
http://example.com/ Forwarding URL
Status code: 301
Destination URL: https://www.example.com/$1

Thanks again for your time!!

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