We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25027
    • 30 Posts
    Before I even install modX, I want to ensure that I can move it from a subdirectory to the root directory once I have it fully functional and all the bugs are worked out. The server is the same and the database will be as well. I have seen this question asked, but not too many confident answers... Shouldn’t it be just a matter of moving the folders/files to the root directory?
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Simply moving, and if you’re using friendly urls changing the base path.

      Just make sure you use relative urls in your content, templates etc.

      As a side note: this forum is intended for reviewing sites and introductions and not for general or specific questions... try the general forum or the more specific forums next time wink
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 25027
        • 30 Posts
        Sorry about the wrong forum - please move this to the appropriate section.

        To be clear(er) on my part, an relative URL would be:

        "../images/example.gif"

        instead of:

        "http://www.filmjackets.com/modx/images/example.gif"

          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Quote from: Rick5150 at Jul 02, 2010, 06:35 AM

          To be clear(er) on my part, an relative URL would be:
          "../images/example.gif"
          instead of:
          "http://www.filmjackets.com/modx/images/example.gif"

          Yes smiley

          You can (and, in my opinion should) place [tt]<base href="[(site_url)]"></base>[/tt] in your template head, and call anything from that path on. So if your site url (as set in MODx configuration) is filmjackets.com/modx, you only need to call /images/example.gif.


          Your name/nick looks familiar to me.. you’re not by any chance in SD are you? (If not, just ignore this tongue)
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 25027
            • 30 Posts
            If by SD, you mean New Hampshire, then yes. grin

            My goal is to get the site running in the modX folder, then after I am happy with it, move everything to the root folder. I expect that if I make the move, I would have to edit any templates that had the filmjackets.com/modx reference...
              • 27708 MODX Staff
              • 2,502 Posts
              You should not hardcode the file path anywhere. CSS and JS can be called relative to the site and use [(site_url)] where you need absolute paths.

              Once done you should then update the setting in site config and when you move your site you will need to clear the cache to remove the old url paths. You will also likly need to change the site root in the .htaccess file as well.
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub