• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Moving from HTTP to HTTPS

#1
I use cloudflare to provide basic SSL cover for my website.

At the moment, I have http://forum.elgrandoc.uk set up to work through the cloudflare service to give me https://forum.elgrandoc.uk

upload_2015-10-23_14-45-12.png

upload_2015-10-23_14-45-24.png


Now, if you click both of the above links, you will see my problem.

I have changed the settings in ADMIN > OPTIONS > BASIC BOARD INFO > BOARD URL to read both http and https... but neither of them seem to work.

Any idea what's going on?

When I used phpBB this worked fine, and I have a rule enabled to force https. What have I done wrong?
 

Robru

Well-known member
#2
Try this in .htaccess

Code:
RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://yoursite.com/$1 [R,L]
     
    RewriteCond %{HTTP_HOST} ^yoursite.com$ [NC]
    RewriteRule ^(.*)$ https://yoursite.com/$1 [R=301,L]
 

Mike

XenForo developer
Staff member
#3
Ideally, you would have CloudFlare request your site using HTTPS (such as via a self-signed certificate). If you can't do that and you only expect to access the site through HTTPS, add this to the end of library/config.php:
Code:
$_SERVER['HTTPS'] = 'on';
 
#5
Ideally, you would have CloudFlare request your site using HTTPS (such as via a self-signed certificate). If you can't do that and you only expect to access the site through HTTPS, add this to the end of library/config.php:
Code:
$_SERVER['HTTPS'] = 'on';

This worked :) Thank you @Mike :D
 
#6
Ideally, you would have CloudFlare request your site using HTTPS (such as via a self-signed certificate). If you can't do that and you only expect to access the site through HTTPS, add this to the end of library/config.php:
Code:
$_SERVER['HTTPS'] = 'on';
Actually - it didn't work! Users had issues getting onto the site.

I feel this might be something to do with the way I've set up the subdomain... people can still access using elgrandoc.uk/forum which I don't want them to do. But if I add a redirect to forum.elgrandoc.uk I get a redirect loop... any ideas?