Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
2.14.4.7. Move core directory outside MODX root directory
For greater security in MODX, you can move the core directory outside the site root directory. To do this, you need to perform the following steps:
- Use the file manager or any FTP client and move the
coredirectory from the site root directory to the level above — to the directory with the name of the main domain (so that it is available at the pathexample.com/core/, whereexample.comis the name of the primary domain). - Edit three files:
config.core.php,manager/config.core.phpandconnectors/config.core.php. In each of them, find the line:define('MODX_CORE_PATH', '/home/user/example.com/www/core/');And replace it with the following:
define('MODX_CORE_PATH', '/home/user/example.com/core/');Instead of
user, specify the hosting account name, and instead ofexample.comspecify the name of the primary domain without subdomains. - In the moved
coredirectory, edit theconfig/config.inc.phpfile and replace all occurrences of/www/core/with/core/. - Check the website's functionality. If errors occur in the functions and classes, double-check all paths to the
coredirectory in the above-mentioned files.