We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3677
    • 130 Posts
    I’ve added the following to the head of my templates:
    <base href="[[++site_url]]"></base>


    Now that I’ve done that, I can use relative paths in all of my href and src calls right? My understanding is that this allows for the most flexibility in moving the site to say a different folder or domain.

    How exactly does the base statement work though? Is ModX always evaluating the leading "/" in any given path and resolving it to the current site_url? If so I should just make sure to always include the leading "/" in my href and src paths then?

    Thanks,
    -Brian
      • 8609
      • 607 Posts
        • 3677
        • 130 Posts
        Oh... I didn’t even realize that base href was a standard html tag.

        In Revolution, [[++site_url]] resolves with a trailing slash. i.e. http://domain.com/

        In my href and src paths I am leading with a "/". This doesn’t seem to be causing any problems (I mean it’s not adding an extra trailing slash).

        Thanks.