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?
-
☆ 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
-
☆ 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
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

)
-
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