We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2807
    • 20 Posts
    Greetings fellow modxers.

    After a bit of fairly fruitless searching for the last hour or so trying to find the best solution to sharing pages between http & https I thought I would ask if I am heading in the right direction;

    I’ve read the Encryption Snippet documentation but don’t really want to go down that road for a few reasons, I’ll explain what I am attempting and hopefully all will become apparent.

    First off; My environment: modx rev 2.0.7, apache with mod-ssl, SSL/https works 100% correctly.

    I’ve been playing with contexts quite a lot recently so thought it might come to my rescue, this however is not appearing to be the case.

    I created a new context ’secure’, added (though it might be overkill)

    server_protocol -- https
    base_url -- /
    http_host -- same-as-web-context
    site_start -- same-as-web-context
    site_url -- https://same-as-web-context-domain/

    Cleared cache (several times) but now any page held under the secure context results in a 404.

    My reason for doing all this is 2 fold;
    1) I can keep all my secured docs in one place without having to muck about with templates etc (ala Encryption snippet)
    2) On the fly change the <base href> to reflect the change to https so that /assets/components/*foo* do not cause warnings with the SSL certificate by being insecure elements in a secured page.

    Any comments welcomed as to whether this is the right approach or not?

    Best,
    Dave