Hi everyone!
I'm using MODX 2.2.8.
I had the following issue on a site: for some reason, whenever I went to 3 pages of my site (mysite.com), all links from there would change to mysite.com
.mx (it would add .mx).
- I am not using any sort of gateway
- Those pages were not using any sort of freeze URIs
- I checked the .htaccess file and nowhere did I see .mx anywhere
- I checked all confing.inc.php files and made sure that site_url, base_url and http_host were set properly (they were)
At one point I thought that it might be a server error since we have a lot of domains pointing to mysite.com, but then I thought "
why would it only do it on those 3 pages?"
I fixed the issue by creating the following settings:
base_url:
/
http_host:
http://www.mysite.com/
site_url:
http://www.mysite.com/
So, I've figured out what the issue was and how to fix it, but I have no idea why it happened. Any idea?
Thanks.
Jean-Marc Buytaert (@jmbuytaert)
MODX truly is the greatest thing that's ever happened to the Internet.
discuss.answer
-
☆ A M B ☆
- 3,141 Posts
Make sure that your <base> tag (if you have it) has an UNCACHED [[!++site_url]] tag, to make sure stuff like that doesn't get cached. It also can't hurt to set up some rewrites on the server to force a single single domain (keep in mind mysite.com and www.mysite.com are different domains too).
It probably happened because someone visited your site via mysite.com.mx and that host got cached. If that domain doesn't exist or doesn't point to the server, it could've been caused by a local host entry.
Mark, almighty MODX Guru, the <base> tag did have a cached [[++site_url]]. You were right! Thanks a lot!
Jean-Marc Buytaert (@jmbuytaert)
MODX truly is the greatest thing that's ever happened to the Internet.