We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37437
    • 147 Posts
    A client of mine just asked me to build him a new site. His current site is totally static, and I would like to use MODx Revolution as the framework for the new site.

    In the interest of avoiding the hassles that come with migrating a new site from a development environment to a live server location, I would like to develop the new site right ’next to’ the existing site out on the server. Is there a reasonable way to do this work ’behind the scenes’ such that the existing static site can remain active and uninterrupted throughout the entire MODx installation and new site development process?
      • 3749
      • 24,544 Posts
      I think the only practical way is to put MODX in a subdirectory, and when you’re ready to switch, either move it or use .htaccess to redirect to it.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If your static site uses index.html, it would be possible to install a MODx site in the root and configure the MODx site to be offline, and have a custom "offline" page redirect to the original index.html page. Logged-in manager users will see the MODx site. The server would have to be configured to have index.php instead of index.html as its primary index page as well.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 22427
          • 793 Posts
          Nice trick - thank you!
            • 37437
            • 147 Posts
            Thanks very much for the feedback.

            Yes, Sottwell, I too had thought of your strategy. Once MODx was installed one could (as you suggested) just specify the index.html file as an offline redirect. My concern would be during the initial MODx installation: I would not want someone to happen upon the site just as I was setting everything up. I can not recall for sure, but wouldn’t MODx override the index.html file until everything was installed and I had a chance to go in to the settings, switch the MODx site to ’offline’ and specify a redirect page?

            BobRay’s suggestion sounds like an interesting option too. Are there any performance issues or other pitfalls with having the MODx site reside in a subdirectory even once it is live?
              • 3749
              • 24,544 Posts
              Quote from: marconi at Apr 25, 2011, 10:12 PM

              BobRay’s suggestion sounds like an interesting option too. Are there any performance issues or other pitfalls with having the MODx site reside in a subdirectory even once it is live?

              I think it takes a server a few milliseconds longer to deliver pages further down in the hierarchy, but I don’t believe there would be any performance hits that would be noticeable.

              There shouldn’t be any other problems once the domain is pointing to the right place.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 37437
                • 147 Posts
                Thanks again BobRay. I will definitely keep your suggestion in mind as I gear up for this project.