Cloudflare

JoyFreak

Well-known member
I moved hosts a few days ago and continued to use Cloudflare's services. However, it looks like my domain without www., with http://www. and http:// is not secure. The only secure urls is with www. When I was with my other host, I told them of the issue and they did something on there end to redirect any url to https://www. But since the move, I cannot figure out what they did. They must have done it through the host rather than Cloudflare. I did look at some info online and tried page rules but no luck.
 
Should be able to handle it either at Cloudflare with Page Rules or on the web server level. I have a page rule "Automatic HTTPS Rewrites: On" for "*.domain.com/*".
 
Yeah tried both but nothing is working. It has been few minutes.. I can wait an hour and see.
 
Gotcha, my use case may be a little different, I have domain.com/forums/... always redirect to https://www.domain.com/forums/...

Did you try the page rule I originally mentioned without the "."?
"Automatic HTTPS Rewrites: On" for "*domain.com/*".

What patterns are allowed in Page Rules?
URLs in Page Rules allow you to use wildcards to apply a Page Rule across multiple pages. For example, you could use *example.com to match both http://example.com and https://example.com.


I have tried incognito mode but still no luck. Try gnonline.net
 
Why are you rewriting at cloudfare level instead of using .htaccess?
I would choose https:// and rewrite everything to that on server level.
 
This has got to be the most frustrating findings after thorough research.. there is a simple option in the Xenforo options under 'Basic board information' with a setting "Enable board URL canonicalization" that does all this for you with a simple click. Amazing!
 
Try this:
Code:
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
The first line is only needed if its not already in your .htaccess file.
 
Try this:
Code:
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
The first line is only needed if its not already in your .htaccess file.

That is kind of you to share but as I said in my previous post, I have found an easy and effective solution to have the board url canonicalization enabled in admin cp which in fact did what I wanted without any alteration to Cloudflare settings nor .htaccess.

This has got to be the most frustrating findings after thorough research.. there is a simple option in the Xenforo options under 'Basic board information' with a setting "Enable board URL canonicalization" that does all this for you with a simple click. Amazing!
 
Last edited:
Top Bottom