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:
- 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 pathexample.com/core/
, whereexample.com
— the name of the main domain). - Edit three files:
config.core.php
,manager/config.core.php
andconnectors/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 ofexample.com
— the name of the main domain without subdomains. - In the transferred directory
core
edit the fileconfig/config.inc.php
and replace all references in it/www/core/
on/core/
. - 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.