I am not sure what is going on, but the system tag [[++site_url]] is producing all sorts of weird domains. I first noticed it while exploring a loss of ranking with Google search, as I discovered urls in Google's database that don't exist on my server, such as smtp.mydomain.com (this canonical does not exist anywhere). And tonight when we posted a link to one of our pages on Facebook, the link harvested by Facebook out of the meta og:url pointed to ftp.myotherdomain.com. This second domain was a separate website, but now the domain get redirected to mydomain.com.
I have gone in and hard coded all of the urls and stripped out the [[++site_url]] from all the templates to avoid any further issues.
But want to know why and what is happening anyway. Is it a bug or is there some setting that contributes? Has anyone else experienced this? I am concerned that maybe these psycho generated urls are contributing to our loss in ranking.
Sounds like you got an wildcard routing to your modx without an explizit configured site_url. Then the first request after an cache refresh will set the site_url to the requested domain.
So check the system_settings or context settings if an site_url is configured, if not create an new setting with site_url an set it to your primary domain.
Do you have multiple front-end contexts? If so, the tag should be uncached:
It's possible that someone is trying to hack the site, and as Michael suggests, whatever URL they use right after the cache is cleared is being cached as the site_url. Calling the tag uncached might help with that also, since it would be regenerated for every request.