<![CDATA[ How Can I Set the site_url setting? - My Forums]]> https://forums.modx.com/thread/?thread=33107 <![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-553015
<?php

    define('MODX_SITE_HOSTNAMES',  'www.example.com,www.example2.com');



It allows the specification of more than one hostname as a comma separated list. Of course, you are free to specify just one hostname without any commas.


Note: The hostnames should not contain the protocol or any path. E.g https://www.example.com and www.example.com/home are both invalid]]>
oyelaking Aug 04, 2017, 05:26 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-553015
<![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181870
The manager seems to be fine now that I setup its .htaccess file, so it’s really just the automatically generated site_url that’s being a problem here. I’ve been fooling around with config.inc.php and looking at how it determines the site_url, and I don’t think there’s a way to make it work right without hardcoding what I need.

If I add this right before it defines the five constants in the middle of the file, then it all works right.
$site_url = 'http://www.example.com/';
$base_url = '/';
[\code]

However, I'd really, really like not to have to hardcode anything.
]]>
Compeek Dec 18, 2009, 11:22 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181870
<![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181869
<base href="http://www.yourDomain.com/" />
]]>
BobRay Dec 18, 2009, 11:19 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181869
<![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181868 Compeek Dec 18, 2009, 11:02 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181868 <![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181867 ]]> BobRay Dec 18, 2009, 10:56 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181867 <![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181866
Even running the installer, the URL is right. The install folder is right in the base of the site. But once I go to the manager, it starts adding the subfolder to the URL, and it also adds the subfolder to all of my links with Wayfinder and so forth. I put an echo() in config.inc.php, and $base_url is being set to include the subfolder, which means site_url includes the subfolder.

dev_cw, I believe you’re explaining the opposite of what I need. tongue I don’t want the subfolder to show up anywhere. I have silent rewrites using mod_rewrite to redirect all calls from the root folder to the subfolder. "modx" should never appear in any URL, and all of my base URLs should be just "/".]]>
Compeek Dec 18, 2009, 10:53 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181866
<![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181865
Another idea is to run the installer in update mode after moving the site to its new location, this will clear the cached settings as well as rewrite the paths accordingly. I regularly run the installer after moving a site just as a precaution.

If you are using the <base> tag you can always enter the URL manually:
<base href="http://www.yourDomain.com/modx/" />


Do you have the htaccess file setup to use the /modx subfolder? This is set in the top section where it says:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /


To use the modx subfolder it should read:
RewriteBase /modx

]]>
dev_cw Dec 18, 2009, 10:51 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181865
<![CDATA[Re: How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181864
Back up the site first, and make sure you uncheck the sample site and snippet options when you install.
]]>
BobRay Dec 18, 2009, 10:50 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181864
<![CDATA[How Can I Set the site_url setting?]]> https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181863
The actually file location relative to the root is something like /modx, but it is accessed in the browser at just the /

I’m using mod_rewrite to redirect everything in the root to the modx subfolder, but modx thinks the site_url includes the modx subfolder, and it shouldn’t.

I’m not sure if that was clear, but does anybody have any ideas?

Thanks!]]>
Compeek Dec 18, 2009, 10:16 PM https://forums.modx.com/thread/33107/how-can-i-set-the-site-url-setting#dis-post-181863