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

    When I preview the site and navigate to the home page in the preview it calls up the existing old site and not the preview of the CMS. Currently I am replacing my client’s existing site with the MODx CMS but his old site is still live in the same folder as the index.php of the CMS. Is that a problem when it comes to previewing? The old site is a .html site while the new one is .php. Is there a setting in the admin that will force the preview to point to index.php and avoid the index.html link?

    thanks,
    Daniel
      • 6696
      • 145 Posts
      Any ideas on this one smiley

      thanks,
      Daniel
        • 3749
        • 24,544 Posts
        You can put this in your .htaccess file, but I think it will break the other site then:

        DirectoryIndex index.php


        I’m not sure there’s a way to have both of them work at the same time.
          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
          • 28690
          • 25 Posts
          I’d like to hear any suggestions on how to do this in Revolution too.

          Is it possible to specify an alternative root page in one of the MODx config files?

          Thanks,
          Stretch
            • 3749
            • 24,544 Posts
            Quote from: Stretch at Dec 08, 2010, 05:10 PM

            I’d like to hear any suggestions on how to do this in Revolution too.

            Is it possible to specify an alternative root page in one of the MODx config files?

            Thanks,
            Stretch

            I’m not sure what you’re trying to do. You can set any page as the root page with the site_start System Setting, but it has to be a MODx document. In order for MODx to work, the index.php file redirects the user to the sit_start MODx document. If it doesn’t, the MODx site won’t work. If it does, the other site won’t work.

            There are two common methods for building a MODx site while the other site is still live.

            1. Build the site locally using XAMPP or the equivalent and move it all to the remote server when it’s done.
            2. Put the MODx install in a subdirectory at the remote site. When it’s finished, either move it to the root, or redirect to it.

            Probably the best method combines the two. Build the site locally. When it’s done, move it to the remote subdirectory for testing. When it’s all working, move it to the root or redirect (do this last step when the site is least active).

            Generally, moving the site to the root simply involves copying the files, changing the rewrite base line in .htaccess (if using FURLS), and running an upgrade install.

            One last tip: regardless of which method above you use, turn off FURLS and rename .htaccess to ht.access as your first step before moving the site. Do the reverse as your last step after everything is working at the new location (rename ht.access to .htaccess and turn on FURLS). It takes a big potential source of confusion out of the picture during the transition.
              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
              • 28690
              • 25 Posts
              Thanks for the reply Bob. I’ve been trying to find a way of running an existing static site and a MODx dev site on the same server, both in the same web root. The static site already uses index.php, so I needed the MODx site to use another filename for its request controller.

              After some hunting through the System > System Settings page in Manager I found a handy little option called Request Controller Filename under the Gateway section. By default it is set to index.php. I have successfully changed it to newsite.php and renamed index.php in the site root (the one used by MODx) to newsite.php too. Furls work provided the reference to index.php in .htaccess is changed to whatever the new request controller filename is (newsite.php in my case). Note, the existing static site did have to go off line for a couple of minutes (temporarily renamed its index.php to something else) while I installed MODx.

                • 3749
                • 24,544 Posts
                Interesting. There may be some hard-coded references to index.php lurking in the code. If not, that may work fine. Let us know if you run into anything. wink

                  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
                  • 28690
                  • 25 Posts
                  Quote from: BobRay at Dec 13, 2010, 01:33 AM

                  There may be some hard-coded references to index.php lurking in the code.

                  Yes, that is my concern. I’ll be testing various settings and addon packages to try and break it. So far it appears to be ok. Simple Search breaks (with FURLs) if you don’t specify a separate landing page for your results.
                    • 3749
                    • 24,544 Posts
                    The NewsPublisher snippet I’m working on would have broken also if you hadn’t pointed out the system setting for me. wink

                    What you’re doing is obviously intended to work or that System Setting wouldn’t be there. I suspect that any problems will be in third-party components. You should be able to fix them by finding the "index.php" in their code and replacing it with:

                    $modx->getOption('request_controller',null,'index.php');


                    (and suggesting that change to their authors).
                      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