Hi,
I have a website on a custom server(not mine) and I cannot figure it out my would base_url be generated differently.
It seems that the company owns 2 domains: www.theirdomain1.com and www.theirdomain2.ab.ca.
Sometimes the base urls is generated with first domain and sometimes with the second which is weird because it did not happened before.
This also breaks all my ajax request since the domains are different. Any idea on how this works?
I could try to force the base url to say www.theirdomain1.com but this is only a temporary solution.
I could also try to define a rule in the .htaccess file.
Thank you
-
MODX Staff
- 10,725 Posts
xpix:
Sounds like they are both routed via the same VirtualHost (or the main DocumentRoot maybe). I you want to serve both, use an uncached snippet to set the base href tag, and you should be able to serve both domains as is. Or, like you said, force all requests not to a certain HTTP_HOST to the one you want the site to serve with a 301 redirect using mod rewrite or a plugin OnWebPageInit.
Thx OpenGeek,
I hardcoded the base_url in the template. Any concerns with this solution?
-
☆ A M B ☆
- 24,524 Posts
Just make sure the config.inc.php file is re-set to read only permissions. The only problem it may cause is if you ever move the site; for that reason I never delete, just comment out unwanted code, and clearly comment any modifications.