We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16085
    • 203 Posts
    How are people using MODx in a local environment where they not using <base href>?

    I’m using /assets/templates... but obviously it doesn’t work unless I put in a base href and make my path assets/templates...

    Recently had a problem with a very cool eCart but didn’t like the caching of base href or assets/templates.. paths. Which is fine to correct once the site is live. But if I want to be able to work on it behind the scene locally I can’t without hard coding the base href in at each path. So I’m looking for a portable live/local way of using absoulte paths instead of using base href. Or at least a work around.

    I’ve tried putting the MODX_BASE_URL in a snippet like the example with an exact path eg: http://localhost/modx rather then the MODx output. But it’s not working how I hope. 

    Anyone have any work around sugguestions.
      • 22303 MODX Staff
      • 10,725 Posts
      Using the BASE tag is the only way to make a site truly portable in MODx. I always use it and all of my sites go from localhost to a variety of server environments with no problems.

      And check that snippet example, it does not use MODX_BASE_URL; it uses MODX_SITE_URL.