We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20751
    • 122 Posts
    Setting up my first modx site using a staging site. I want modx to rewrite image src paths so that they’re relative instead of absolute so I’m able to move to the production site when I go live!

    I choose "Yes" in the misc settings in the Rewrite image paths? setting, click save, refresh the site and it still calls images as http://www.sitename.com/assets/images/image.jpg. Shouldn’t this be /assets/images/image.jpg with this setting?

    I’m using friendly urls - does that make a difference?

    I also tried changing the base href from [(site_urel)] to [(base_url)] but that didn’t work either.

    I’ve tested it on existing pages and created entirely new pages and still no joy.

    Any suggestions?

    PS I’ve been using this cms for 3 hours and I’m totally in love!!!
      • 10487 MODX Staff
      • 1,535 Posts
      Hi myan24,

      Check out the advice in this post: http://modxcms.com/forums/index.php/topic,2470.0.html

      I’ve been using that method to transfer sites between my local machine and my live server and it works a treat.

      Have fun with your MODx’ing, Garry
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 8461
        • 205 Posts
        I have found it necessary to add /assets/ to the resorce URL in system settings / interface and editor settings to ensure relative paths are used. If you image is in a sub directory you will have to incldue that also. This worked for me with friendly URLs

        I also tend to put the full resource path in also, e.g /home/sites/yoururl.com/public_html/assets/

        But I am sure someone can advise better
          • 20751
          • 122 Posts
          Thanks Garryn and Edge! That post worked a treat!

          This thing is totally awesome!!! grin