We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30385
    • 12 Posts
    Hi,

    Where is the variable site_url set? I can’t find it anywhere

    There has already been a previous posting on this issue here: http://modxcms.com/forums/index.php/topic,44698.0.html

    I’m having the same problem. Suddenly all menu urls had the server ip address instead of the domain. Clearing the cache has changed the urls back to the domain name again. I’m trying to find an explanation to this - could it be due to dns changes or is the site_url hard-coded somewhere (really, really hard to find!!).

    Thanks in advance,
    Tony
      • 26903
      • 1,336 Posts
      Its set in your config.inc.php file under/manager/includes, built from PHP globals such as $_SERVER[’HTTP_HOST’] and the like, its generated on every page access so if you change your DNS settings it will follow it, except for cached items of course.
        Use MODx, or the cat gets it!
        • 30385
        • 12 Posts
        Thanks for the reply - that answers my question completely.
          • 30385
          • 12 Posts
          The IP address is back again!?!

          I’m getting weird behaviour with this... The client is saying that the dns hasn’t been changed for months, yet ’suddenly’ the menu is being made up of the ip address instead of the domain name. Clearing the cache in the Cms earlier today rectified it, but now a few hours later, the ip address is back again.

          Is there a reason why this is happening and is there a solution to make sure that the domain is displayed regardless of dns changes? Note: any work around would have to factor in a solution for both htttp and https pages on this particular site.

          Thanks in advance,
          Tony
            • 26903
            • 1,336 Posts
            When this happens log into the manager and look at Reports/System Info, what values does it print for MODX_SITE_URL?
              Use MODx, or the cat gets it!
              • 30385
              • 12 Posts
              Hi Shamblet,

              It gives the domain name... all very confusing!

              Tony
                • 26903
                • 1,336 Posts
                Hmm, $_SERVER[’HTTP_HOST’] gives you the host as supplied in the HTTP header, so maybe someone is addressing you by IP, have a look in your server access logs.
                  Use MODx, or the cat gets it!
                  • 30385
                  • 12 Posts
                  Hi Shamblet,

                  I’ve decided to hard code the base url

                  Thanks for your help.

                  Tony