We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1752
    • 3 Posts
    Hi,
    I configured modx with a localhost connection. It configured site_url to localhost because of that. I need to change site_url, but I can’t find where it is configured.

    Thanks,
    Annirak
      • 5340
      • 1,624 Posts
      Why?

      I have no knowledge of such a parameter
        • 20413
        • 2,877 Posts
          @hawproductions | http://mrhaw.com/

          Infograph: MODX Advanced Install in 7 steps:
          http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

          Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
          http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: Annirak at Nov 12, 2008, 03:17 PM

          I configured modx with a localhost connection. It configured site_url to localhost because of that. I need to change site_url, but I can’t find where it is configured.
          The site_url is dynamically created based on the HTTP_HOST value of the server, along with some other variables. Perhaps all you need to do is clear your cache and access your site using the URL you want to access it from.

          Quote from: mrhaw at Nov 12, 2008, 04:02 PM

          Maybe this can help you ---> http://modxcms.com/forums/index.php/topic,2035.msg14333.html#msg14333
          That information is a bit out of date. You can still set those values directly in the manager/includes/config.inc.php, but they should come before the lines defining the constants which have been added since that old post was written, e.g.:
          // manually override base_path, base_url and/or site_url
          $base_path = '/full/path/to/your/modx/';
          $base_url = '/';
          $site_url = 'http://domain.tld/';
          
          if (!defined('MODX_BASE_PATH')) define('MODX_BASE_PATH', $base_path);
          if (!defined('MODX_BASE_URL')) define('MODX_BASE_URL', $base_url);
          if (!defined('MODX_SITE_URL')) define('MODX_SITE_URL', $site_url);
          if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.'manager/');
          if (!defined('MODX_MANAGER_URL')) define('MODX_MANAGER_URL', $site_url.'manager/');
          
            • 3749
            • 24,544 Posts
            Quote from: Annirak at Nov 12, 2008, 03:17 PM

            Hi,
            I configured modx with a localhost connection. It configured site_url to localhost because of that. I need to change site_url, but I can’t find where it is configured.

            Thanks,
            Annirak

            The only reason I can think of for changing it is moving the site to another server. When you do that, running install will automatically change the site-related variables. If the site is already there, just do an upgrade install and they should get reset without losing any of your work. As always, it’s a good idea to back up first.

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 1752
              • 3 Posts
              The problem is that
               <base href="[(site_url)]"></base>

              Resolves to
              <base href="http://localhost/modx-0.9.6.2/"></base>

              regardless of where I connect from.

              I can force it in config.ini.php, but I’d rather do it the right way.
                • 1752
                • 3 Posts
                Further information,
                I’m using DNS forwarding which, practically, means that my content is loaded in a frameset so that the proper domain is displayed in the address bar.
                  • 7231
                  • 4,205 Posts
                  Did you try clearing the modx cache? Since this value is dynamic it should change automatically if it doesn’t then it may be cached.

                  Maybe it would be cool to have a resync option in the manager to reset the server settings after moving a host without having to run the installer.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]