1. 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

Discussion in 'Server Configuration and Hosting' started by ElgrandOC, Oct 23, 2015.

  1. ElgrandOC

    ElgrandOC Member

    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



    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?
  2. Robru

    Robru Well-Known Member

    Try this in .htaccess

    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]
  3. Mike

    Mike XenForo Developer Staff Member

    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:
    $_SERVER['HTTPS'] = 'on';
    rafass, ElgrandOC and Robru like this.
  4. ElgrandOC

    ElgrandOC Member

    Gives me this


  5. ElgrandOC

    ElgrandOC Member

    This worked :) Thank you @Mike :D
  6. ElgrandOC

    ElgrandOC Member

    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?

Share This Page