We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39131
    • 84 Posts
    Good evening,

    I'm about to switch one of my sites to SSL.

    I've already searched for more information, but all I could find was
    https://www.markhamstra.com/modx/2012/07/3-tips-for-serving-a-modx-site-over-ssl/
    .

    Any do's and/or dont's when going from HTTP to HTTPS?

    Thanks in advance!

    This question has been answered by michelle84. See the first response.

      • 19328
      • 433 Posts
      Not really more that the ones you find in Mark's blog. I've done a couple of HTTP > HTTPS switches, and all went well.

      Also, add to your htaccess the following:

      # Redirect all "not correct" domain to www with https
      # (is not important if comes with or without https):
      RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
      RewriteRule ^(.*)$ https://www.mysite.com/$1 [L,R=301]
      
      # Redirect all non-ssl to ssl
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]


      If you run into problems, let us know!
        • 39131
        • 84 Posts
        Thanks for your answer Michelle.

        I suppose that a normal certificate with only domain validation is fine or should I use another one to work with MODX?




        • discuss.answer
          • 19328
          • 433 Posts
          Yes, that should be fine. It's just about how much you/your client wants to spend, and how much you/your client wants a visitor to feel 'safe' on your site.

          I mostly use the cheap GeoTrust RapidSSL for sites with low value. Maybe for a huge webshop I'll use the more expensive ones.
            • 39131
            • 84 Posts
            Looks like it is not working.

            When I paste your code in htaccess, I get loop errors in the browser.

            Now the code in my htaccess is:

            RewriteCond %{HTTP_HOST} .
            RewriteCond %{HTTP_HOST} !^www\.nmldesign\.nl [NC]
            RewriteRule (.*) http://www.nmldesign.nl/$1 [R=301,L]


            That is working fine, only [[!++site_url]] is still pointing to http://www.nmldesign.nl/ and not httpS://www.nmldesign.nl/

            Any ideas?