Welcome to Centmin Mod Community
Register Now

SSL http to https forced redirect

Discussion in 'Domains, DNS, Email & SSL Certificates' started by Matt Williams, Nov 12, 2015.

  1. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    7:12 PM
    latest
    10
    I am having a bit of trouble. I've tried several ways to redirect all http to https and I just keep getting a redirect loop. How do I properly create a perm. redirect from http to https?

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Posted at centminmod.com/nginx_domain_dns_setup.html#httpsredirect

    key to testing is using 302 temp redirect first in a private incognito browser session otherwise the problems you can experience may end up being due to browser caching or 301 permanent redirects unless you clear browser cache and reboot local computer(s) and even then some web browsers don't let go of 301 permanent redirect browser cache that willingly heh
     
  3. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    7:12 PM
    latest
    10
    is what I was missing :mad:
    Thanks Eva!
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah ha ! :D
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    7:12 PM
    latest
    10
    It's always something simple that I tend to overlook lol!
    BTW: hows the LetsEncrypt coming along? Been following it and I'm excited! I'm thankful that you are smart enough to do all this. You are amazing my friend!
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    7:12 PM
    latest
    10
    How would I set up a redirect so the public view sees http ONLY and the WP admin is covered with https?

    Use:

    ?
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that should work, or you can leave individual http and https vhost conf files and just add to wp-config.php

    Code:
    define('FORCE_SSL_ADMIN', true);
    or both
     
  9. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    7:12 PM
    latest
    10
    so to reverse this:
    I do:
    Right?
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:12 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah and make sure all wp related settings are replicated in both http and https vhost conf files, just in http one add the redirect to https

    that's essentially what i did for phpmyadmin addon installer's https redirect
     
  11. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    7:12 PM
    latest
    10
    Thanks Eva! My clients make me :banghead: sometimes and :mad: at times but it always is (y)