Quote from: sottwell at Jun 26, 2013, 07:27 PMThe site_url is calculated from the $_SERVER[HTTP-HOST] in the config.inc.php file on each page request. Of course, your page will get cached with the value used for the first request of the page, which is why calling it uncached will get the actual value calculated for that page request.
I have "parked" domains pointing to my main domain, and sometimes one of the parked domains gets requested. So I have used .htaccess rewrite rules to rewrite anything with those parked domains into my main domain. That way by the time MODx sees the page request, it's been rewritten so all MODx ever gets it my main domain.
Sometimes web servers are configured in such a way that these $_SERVER values aren't really reliable. You can always set a context setting for the "web" context with the site_url that you want.
hi sottwell,
i, just yesterday, started experiencing this phenomena - where my base href site_url would change to one of our parked/alias domains, & thusly breaking the linked-to font & js libraries. it really concerned me as 1) i don't understand these things, & 2) apparently my host is undergoing a big DDS attack or something. so i was scared i got hacked.
but from what i'm reading, it's a fairly common thing to have happen. i HAVE double-checked all my config.inc.php files & htaccess - all seems to be in order.
i will implement the exclamation point to uncache the call & hope that helps. but after reading your post here, i have a couple questions, i f you don't mind...
1) what would change about a server that would suddenly cause this to happen?
2) can you share these "htaccess rewrite rules" you speak of please?
3) and, is it possible to, if i point a different domain i have to a specific directory, to have pages shown from that directory to use this domain in the field of the browsers, then when clicking on a link to a different directory, or even the homepage, switch back to the main domain - all the while sharing the same resources, css/js/etc???
if so, how? but i suspect you're gonna say 'no'.
THANKS!!!