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

    I’m about to start the build on a site and am hoping to do this using
    MODx instead of it being a static site.

    I need to have a couple pages on a secure server (i.e https) but have
    no idea about how to get this done.

    Anyone able to give me a bit of info...or direct me to somewhere what
    can help?

    thanks,
    Greg.
      • 26016
      • 561 Posts
      Hi,
      I just did a procedure like this. I only needed HTTPS for a particular "folder", and the code I used was like this in the root .HTACCESS file of the site. If you’re using FURL’s, you’ll need to place this in the HTACCESS file carefully along with your FURL’s code, usually near the top. Make a backup just in case.

      By the way, the method below is not unique to MODx at all - it could be used for any type of site on a typically set up Unix server. The RewriteRule could be more specific if you want a particular document, etc.

      RewriteEngine On 
      RewriteCond %{SERVER_PORT} 80 
      RewriteCond %{REQUEST_URI} somefolder 
      RewriteRule ^(.*)$ https://www.domain.com/somefolder/$1 [R,L]


      If editing .HTACCESS makes you uncomfortable, and it did for me at first, I would suggest reading up on "mod_rewrite", "htaccess", etc. via Google. Backups are important - a badly messed up .HTACCESS can totally kill your site. A good example of a big mess would be if you have a site that already relies on a fancy HTACCESS file. If you mess it up, it’s not like you can just delete it and get your site to work again.

      It seems to me there are a couple snippets floating around that try to do this, but they didn’t work on my server config. You could look for those and try them for a MODx-specific solution.

      Hope this helps.
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4