We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Quote from: BobRay at Sep 12, 2018, 07:59 AM
    The server_protocol setting should definitely be set to https. Try setting that and manually deleting all files in the core/cache directory.

    If that doesn't do it, I'd add a rewrite rule to .htaccess to always convert http to https.

    Thanks Bob - I have already experimented with the server protocol as both 1 and https.
    Each time I deleted the core/cache directory.

    I already have a rewrite rule in .htaccess which pushes people from http to https - but the problem is that MODX is create the base href as http://domain.com - so it still doesn't.

    Pulling my hair out!

    Andy
      • 3749
      • 24,544 Posts
      Is the rewrite rule at the top?

      What does it look like?
        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 Sep 18, 2018, 03:48 AM
        Is the rewrite rule at the top?

        What does it look like?

        It's not at the top of my .htaccess file - should it be?

        This is how it looks:

         <IfModule mod_rewrite.c>
            RewriteCond %{SERVER_PORT} !^443
            RewriteRule ^ https://www.domain.co.uk%{REQUEST_URI} [R=301,L]
         </IfModule>
        


        Thanks
        Andy
          • 38783
          • 571 Posts
          I have the following in mine:

          RewriteCond %{SERVER_PORT} 80
          RewriteRule ^(.*)$ https://yourdomain.co.uk/$1 [R,L]


          I am not sure if you need the opening and closing tag in a .htaccess file?

          <IfModule mod_rewrite.c>
          ...
          </IfModule>


          I think you that maybe only need those in an apache config file?

          Very important disclaimer: I am not an expert on .htaccess files!

            If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

            email: [email protected] | website: https://andytough.com
            • 51020
            • 670 Posts
            Quote from: andytough at Sep 18, 2018, 12:44 PM
            I have the following in mine:

            RewriteCond %{SERVER_PORT} 80
            RewriteRule ^(.*)$ https://yourdomain.co.uk/$1 [R,L]


            I am not sure if you need the opening and closing tag in a .htaccess file?

            <ifmodule mod_rewrite.c="">
            ...
            </ifmodule>


            I think you that maybe only need those in an apache config file?

            Very important disclaimer: I am not an expert on .htaccess files!


            Thank you. I will have a play with that.

            The strange thing is that I use the same .htaccess file on almost all my sites - and this is the only problem one.

              • 3749
              • 24,544 Posts
              I have this:

              #RewriteCond %{SERVER_PORT} 80
              #RewriteRule ^(.*)$ https://yourdomain.com/$1
                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 Sep 18, 2018, 06:03 PM
                I have this:

                #RewriteCond %{SERVER_PORT} 80
                #RewriteRule ^(.*)$ https://yourdomain.com/$1

                Thanks - same as me - apart from I have this at the end:

                [R,L]

                Any idea what this means?

                  • 3749
                  • 24,544 Posts
                  The R is for redirect, and the L says it's the last instruction (causes mod_rewrite to stop processing the rule set). I honestly don't know which version is better. My thinking was that letting the processing fall through to the MODX rewrite rules would be more efficient, but I could be wrong.

                  In your case, it's probably worth testing my version to see if it helps, though I doubt if it will.
                    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 Sep 19, 2018, 05:07 PM
                    The R is for redirect, and the L says it's the last instruction (causes mod_rewrite to stop processing the rule set). I honestly don't know which version is better. My thinking was that letting the processing fall through to the MODX rewrite rules would be more efficient, but I could be wrong.

                    In your case, it's probably worth testing my version to see if it helps, though I doubt if it will.

                    Thank you - it didn't change anything.
                    I don't think it can have anything to do with the htaccess file, because it's a standard one which I use on most of my sites.

                      • 3749
                      • 24,544 Posts
                      I'm stumped. sad
                        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