We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16505
    • 14 Posts
    Hello, i took a look at my website and something was wrong. I found out that the site url was changed. Where can I rechange this?
      Jezus is Stoer, ik nummer 2.
      • 22303 MODX Staff
      • 10,725 Posts
      It’s automatically determined by the $_SERVER[’http_host’] variable, and this issue should really be fixed at the webserver/PHP level. However, if you cannot address it at that level, you can override the MODx automatically determined paths and URLs by hardcoding (or authoring alternate logic for) all of the appropriate variables in your manager/includes/config.inc.php file, e.g.

      ...
      
      $https_port = '443';
      
      // HARDCODE YOUR VARIABLES HERE
      $base_path = '/absolute/path/to/modx/root/dir/';
      $base_url = '/';  // absolute URL from web server document root
      $site_url = 'http://domain.tld' . $base_url;  // full url including scheme and hostname
      
      // automatically assign base_path and base_url
      if(empty($base_path)||empty($base_url)||$_REQUEST['base_path']||$_REQUEST['base_url']) {
      ...
      
      


      BEWARE: This really should be automatically determined based on the request received by the web server and some advanced functionality, e.g. supporting switching between SSL-secured pages and non-secure pages, might not be usable if you do choose to hardcode these variables in the MODx configuration file.