Join the community today
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

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    10:20 AM
    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

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:20 AM
    Nginx 1.13.x
    MariaDB 5.5
    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
     
    • Informative Informative x 1
  3. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    10:20 AM
    latest
    10
    is what I was missing :mad:
    Thanks Eva!
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:20 AM
    Nginx 1.13.x
    MariaDB 5.5
    ah ha ! :D
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    10:20 AM
    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!
     
    • Like Like x 1
  6. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:20 AM
    Nginx 1.13.x
    MariaDB 5.5
  7. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    10:20 AM
    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

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:20 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    10:20 AM
    latest
    10
    so to reverse this:
    I do:
    Right?
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:20 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    10:20 AM
    latest
    10
    Thanks Eva! My clients make me :banghead: sometimes and :mad: at times but it always is (y)