2.13.6.7. Moving the core directory outside the MODX root directory

For more security in MODX, you can move the core directory outside of site root directory... To do this, you need to do the following:

  1. Through filemanager or any FTPclient transfer directory core of site root directory one level up — to the directory with the name of the main domain (so that it is accessible along the path example.com/core/, where example.com — the name of the main domain).
  2. Edit three files: config.core.php, manager/config.core.php and connectors/config.core.php... Find the line in each of them:
    define('MODX_CORE_PATH', '/home/user/example.com/www/core/');

    And replace it with this:

    define('MODX_CORE_PATH', '/home/user/example.com/core/');

    Instead user indicate the name hosting accountand instead of example.com — the name of the main domain without subdomains.

  3. In the transferred directory core edit the file config/config.inc.php and replace all references in it /www/core/ on /core/.
  4. Check the site is working. In case of errors in the called functions and classes, double-check all the specified paths to the directory core in the above files.
Content