We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47401
    • 295 Posts
    hi

    Ive been working on this for a number of days now, and can not find away to have 1 modx site with 1 context, for 2 domains. I have however configured apache correctly, and 2 domains are pointing to the same apache instance which is not the problem.

    please correct me if im wrong, the problem im finding is that:

    the site_url value can not contain snippets, therefor can not be dynamically generated depending on what the HTTP_HOST is? im finding that links seem to be outputting the snippet, rather than achully outputting the url, so for example im seeing http://www.domain.com/[[getsiteurl]][[getsiteurl]]/page-name.html?blah-blah

    where it should be http://www.domain.com/page-name

    please advise on how to do this. I have tried contextrouter and also tried http_host_alises which doesnt seem to do anything, I have followed the contextrouter instructions which unfortunitly dont seem to be very helpfull.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      site_url is dynamically generated by the config.inc.php file on every page load. In your case, you will always need to use the uncached form of the setting tag - [[!++site_url]]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org