We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36959
    • 22 Posts
    I am not sure if I did it this correctly. I have a MODx 1.0.2 site up and running on a CentOS 5.3 box. I wanted to have both HTTP and HTTPS protocols available for services. The goal is that if people access my site via HTTP://something, they will stay in the HTTP during their browsing, unless they browse to some pages that have to be served at HTTPS (e.g. manager login). If people access my site started from HTTPS, they will stay at HTTPS during their browsing.

    I have configured the SSL certificate on the CentOS box and it appears to be working. I am not using any plug-ins for SSL by the way.

    However, I am facing a problem: HTTPS works fine without any issue when people browsing my site via HTTPS, as long as the friendly URL is NOT turned on! When friendly URL is turned on (I am using the standard mod_rewrite method), HTTPS works only for the home page, clicking any other pages when you are at https://homepage will return error 404.

    I would love to make the HTTPS works with friendly URL. I am suspecting that it may be the way I setup the HTTPS on CentOS box was causing the issue. But going through the MODx documentation didn’t tell me that I needed any special steps to setup the HTTPS. It appears to me that setting up HTTPS is totally Apache stuff, MODx doesn’t really care about how the web server is setup.

    Appreciate if you guys can help me with that.

    Regards!
    Johnmen
      • 25663 MODX Staff
      • 12,272 Posts
      What’s the contents of your htaccess file?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 36959
        • 22 Posts
        I don’t use .htaccess file as the MODx site is running on my own box at my house. You can access my site at http://www.johnmen.com

        Instead, this is the virtual host configuration I use in the httpd.conf file:
        ----------------------------------------------------
        <VirtualHost *:80>
        DocumentRoot "/MODx1"
        <Directory "/MODx1">
        allow from all
        Options +Indexes

        # For full documentation and other suggested options, please see
        # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
        # including for unexpected logouts in multi-server/cloud environments

        Options +FollowSymlinks
        RewriteEngine On
        RewriteBase /

        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]

        # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
        #RewriteCond %{HTTP_HOST} .
        #RewriteCond %{HTTP_HOST} !^www\.johnmen\.com [NC]
        #RewriteRule (.*) http://www.johnmen.com/$1 [R=301,L]

        # Exclude /assets and /manager directories from rewrite rules
        RewriteRule ^(manager|assets) - [L]

        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

        # Reduce server overhead by enabling output compression if supported.
        # php_flag zlib.output_compression On
        # php_value zlib.output_compression_level 5

        </Directory>
        <VirtualHost>
        ----------------------------------------------------