We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Try putting this near the top (below the RewriteEngine on and RewriteBase lines)"
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
      • 52728
      • 3 Posts
      Quote from: tm2000 at Dec 12, 2017, 04:02 PM
      Hi there,

      So I have an SSL certificate installed, but my base_url uses [[++site_url]] and still says 'http://www.domain.com'.
      I have changed the server_protocol setting to https
      I have emptied the cache
      I have manually emptied the core/cache folder.

      I've installed certs before and not had this problem!

      I can't think what else I can do?

      For now I have manually changed the base_url to 'https://www.domain.com' and it works fine, but I would much prefer to use '[[++site_url]]'

      Hi Andy,

      I've got the same issue and nothing from suggested here in this thread is not working for me.
      Have you fixed the issue? If so, please give me an idea how?
      Thanks in advance!
        • 51020
        • 670 Posts
        Quote from: oleksiy.ostapenko at Jan 30, 2018, 09:56 AM
        Quote from: tm2000 at Dec 12, 2017, 04:02 PM
        Hi there,

        So I have an SSL certificate installed, but my base_url uses [[++site_url]] and still says 'http://www.domain.com'.
        I have changed the server_protocol setting to https
        I have emptied the cache
        I have manually emptied the core/cache folder.

        I've installed certs before and not had this problem!

        I can't think what else I can do?

        For now I have manually changed the base_url to 'https://www.domain.com' and it works fine, but I would much prefer to use '[[++site_url]]'

        Hi Andy,

        I've got the same issue and nothing from suggested here in this thread is not working for me.
        Have you fixed the issue? If so, please give me an idea how?
        Thanks in advance!

        Nothing worked for me either - I ended up hardcoding the base_url with https://www.domain.com instead of using the tag [[++site_url]], which works, and as I'm not going to be changing the domain any time soon, this is OK for me - but still frustrating that it doesn't work - especially because I have several other sites which are all fine!

        Would that solution work for you?

        Andy
          • 3749
          • 24,544 Posts
          Try this in the head section of all your templates (with the exclamation point):

          <base href="[[!++site_url]]" />
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 51020
            • 670 Posts
            Quote from: BobRay at Jan 31, 2018, 12:29 AM
            Try this in the head section of all your templates (with the exclamation point):

            <base href="[[!++site_url]]">

            Thanks Bob - I tried this previously, and just checked again now, but doesn't work - the site_url still is without https. Very odd.

            Andy
              • 52728
              • 3 Posts
              Quote from: BobRay at Jan 31, 2018, 12:29 AM
              Try this in the head section of all your templates (with the exclamation point):

              <base href="[[!++site_url]]">

              Nope, as I mentioned previously thats not working sad
                • 52728
                • 3 Posts
                Quote from: tm2000 at Jan 30, 2018, 09:59 AM
                Quote from: oleksiy.ostapenko at Jan 30, 2018, 09:56 AM
                Quote from: tm2000 at Dec 12, 2017, 04:02 PM
                Hi there,

                So I have an SSL certificate installed, but my base_url uses [[++site_url]] and still says 'http://www.domain.com'.
                I have changed the server_protocol setting to https
                I have emptied the cache
                I have manually emptied the core/cache folder.

                I've installed certs before and not had this problem!

                I can't think what else I can do?

                For now I have manually changed the base_url to 'https://www.domain.com' and it works fine, but I would much prefer to use '[[++site_url]]'

                Hi Andy,

                I've got the same issue and nothing from suggested here in this thread is not working for me.
                Have you fixed the issue? If so, please give me an idea how?
                Thanks in advance!

                Nothing worked for me either - I ended up hardcoding the base_url with https://www.domain.com instead of using the tag [[++site_url]], which works, and as I'm not going to be changing the domain any time soon, this is OK for me - but still frustrating that it doesn't work - especially because I have several other sites which are all fine!

                Would that solution work for you?

                Andy

                yep, I hardcoded the domain with https too, because the [[++site_url]] is not working for me like in your case.
                But still wondering to get any new idea of fix smiley
                  • 9674
                  • 170 Posts
                  Hi have you make sure with your servers setup (usually in panels that there is no forced rules that rewrites with 301 the https to http ?

                  This happened to me on one plesk instance.
                    • 51020
                    • 670 Posts
                    Quote from: Fildefer57 at Jan 31, 2018, 12:17 PM
                    Hi have you make sure with your servers setup (usually in panels that there is no forced rules that rewrites with 301 the https to http ?

                    This happened to me on one plesk instance.

                    Thanks - I checked but there's nothing there forcing https. It's a mystery!
                      • 3749
                      • 24,544 Posts
                      I looked again and this is what I actually have at my site in .htaccess:


                      RewriteCond %{SERVER_PORT} !^443
                      RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
                      RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
                      RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
                      RewriteRule (.*) https://mysite.com/$1 [R=301,L]



                      I'm not sure where lines 2-4 came from or whether they're necessary. mysite.com should be changed to the actual domain.

                      Also, make sure you're editing the .htaccess file in the MODX root directory (not the core or manager) and not the ht.access file.

                      Be sure the code comes after these lines:

                      RewriteEngine On
                      RewriteBase /
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting