So, it’s only taken me a dozen or so site moves (from a staging server to the live URL) to figure this out, but here’s my tip:
If you’ve ever developed a site at a staging URL, either the IP or a different domain, you’ve probably run into problems when you’ve moved it to the live URL. This is usually because the RTE makes your paths complete URLs, so instead of having the src of an image be /assets/images/pic1.jpg, it turns into
http://stagingdomain/assets/images/pic1.jpg
If you have more than a couple pages, it’s a pain to go back and manually change each broken image once the site is live.
The fix? Turn
off the "Image Rewrite Paths" in the manager, and change the "Resource URL" from "
http://mydomain.com/assets" to just "/assets/" (no quotes, of course).
Now all your resources should be made with the absolute path from the web root, which is a good strategy, in my experience. This approach would need to be modified to work on installations where MODx is not in the web root.
If anybody has any other advice on how to do this, or reasons that the above approach is wrong, let me know, but it seems to work better than any other option for me, and I haven’t had any problems with it. Also, if anybody knows why the default Resource URL has the http://domain/ in it in the first place, I’d love to hear.
-Brett