We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34197
    • 138 Posts
    Hi everyone.

    I am trying to secure my manager using SSL.

    I don’t want to use SSL for the whole website ( not yet ).

    I have tired the code on this page with no luck:
    https://rtfm.modx.com/revolution/2.x/administering-your-site/security/hardening-modx-revolution

    RewriteEngine On
    RewriteBase /
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://yoursite.com/manager/$1



    Any suggestion?


    Thanks


    .htaccess in base folder looks like this:

    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
    RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
      Webdesigner and musician.
      • 34197
      • 138 Posts
      And also, if I want to secure the entire website.

      Let’s say I want to move from:
      http://www.mywebsite.com => https://www.mywebsite.com



      How can I correctly alter my .htaccess ( optimized for search engine with 301 redirect ) ?
      Is there any changes to make to the manager and config files?


      Thanks
        Webdesigner and musician.
        • 28432
        • 372 Posts
        Quote from: carlo_13 at Aug 19, 2016, 09:01 AM
        And also, if I want to secure the entire website.

        For the entire website you just need to add an S after http like this :
        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
        RewriteRule (.*) https://www.example-domain-please-change.com/$1 [R=301,L]


        Maybe you have to check your config.inc.php in the core/config/ folder, to see if there no error with the http_host. In my case : www.website.tld work for me.
        Try to clear cache too ;-)
        I hope this help.
          • 34197
          • 138 Posts
          @Steeve

          Thanks for your answer.

          Well I've tried that, but even after clearing the cache, it's still redirecting to the http://
          I guess modx stores the "base url" somewhere.


          Did you install modx straight to https ? Or did you switch from http to https ?


          Thanks for your help anyway.
            Webdesigner and musician.
            • 28432
            • 372 Posts
            Quote from: carlo_13 at Aug 20, 2016, 03:22 AM
            Did you install modx straight to https ? Or did you switch from http to https ?
            I switch from http to https.
            You're right! I think MODX store it in the context.
            Have you check your config.inc.php file ?
              • 34197
              • 138 Posts
              Hi.

              Yes I checked the file, I didn't find an absolute path but just the domain name.

              Kinda weird.

              Thanks anyway
                Webdesigner and musician.
                • 28432
                • 372 Posts
                Quote from: carlo_13 at Aug 22, 2016, 03:25 AM
                Yes I checked the file, I didn't find an absolute path but just the domain name.
                Is there WWW.website.tld ?
                  • 34197
                  • 138 Posts
                  Quote from: Steeve at Aug 22, 2016, 03:30 AM
                  Quote from: carlo_13 at Aug 22, 2016, 03:25 AM
                  Yes I checked the file, I didn't find an absolute path but just the domain name.
                  Is there WWW.website.tld ?

                  Yes there is. Is this the issue ?


                    Webdesigner and musician.
                    • 28432
                    • 372 Posts
                    Quote from: carlo_13 at Aug 22, 2016, 03:25 AM
                    Yes there is. Is this the issue ?
                    Yes! Sorry but i can't help you more.
                    For me it was really simple and quick, maybe i forgot something.
                      • 34197
                      • 138 Posts
                      Quote from: Steeve at Aug 22, 2016, 03:46 AM
                      Quote from: carlo_13 at Aug 22, 2016, 03:25 AM
                      Yes there is. Is this the issue ?
                      Yes! Sorry but i can't help you more.
                      For me it was really simple and quick, maybe i forgot something.


                      No worries, and thanks for helping!

                      By the way, what should I do if I only want https:// for the manager ?

                        Webdesigner and musician.