I followed all the instructions to install the ModX revolution environment on a localhost it seems to have installed with no errors however all links to the css/js files is an invalid path.
The problem is that the manager/ directory is being included in every location(sometimes duplicated). What is the best way to remove this from the absolute path.
/*duplicated here */
`GET http://127.0.0.1/manager/manager/assets/ext3/resources/css/ext-all-notheme-min.css `
/*this should be not contain manager/ at all*/
`GET http://127.0.0.1/manager/connectors/layout/modx.config.js.php?action=&wctx=mgr `
Something may have gone wrong during your installation process, or you may need to modify a server configuration. To troubleshoot possibility #1, check the paths in your MODX configs.
Paths in MODX, with the exception of quite old versions of the software, are configured in exactly 4 php files.
3 of those, are instances of config.core.php
, which simply contain:
<?php
define('MODX_CORE_PATH', '/path/to/core/');
define('MODX_CONFIG_KEY', 'config');
?>
Note that MODX_CORE_PATH
is the absolute path to your MODX core folder, and MODX_CONFIG_KEY
can be customized during the install process, but 'config'
is the default.
The 3 instances of the file are located in:
'/'
'/connectors/'
'/manager/'
All 3 of them should contain identical copies of config.core.php
and the PHP constants therein must be assigned with valid values. The core folder should be owned by the same user that is executing MODX (PHP) and should have 0755
for permissions (occasionally 0775
is needed but not recommended on shared hosting environments).
The 4th config file, the most important one, is located in a subfolder of MODX_CORE_PATH
, called config
and the filename is MODX_CONFIG_KEY . '.inc.php'
. In the above example it would be: /path/to/core/config/config.inc.php
That file defines constants with absolute paths and absolute URLs (relative to the web root) for all the folders, to which your MODX install requires access. As well, the path and URL to the web root is defined there as well; MODX_BASE_PATH
and MODX_BASE_URL
, respectively.
The installer should have populated all these with the correct values already, but it's good troubleshooting practice to check those paths, when you have an error related to paths.
Your server configuration can also come into play here. If you have MODX installed in a subfolder, for example, rather than the root of your local web server, you would need to ensure the paths include that.
Also, if you've enabled Friendly-URLs in the MODX install, you would want the Apache RewriteBase
, or nginx equivalent, to have the correct value. Let's say your local web server is setup in:
/Applications/MAMP/htdocs/
and your MODX install is at /Applications/MAMP/htdocs/modx-test/
you would expect MODX to respond at:
http://127.0.0.1/modx-test/index.php
Your MODX_BASE_PATH
is /Applications/MAMP/htdocs/modx-test/
Your MODX_BASE_URL
is /modx-test/
and in your .htaccess
file you would have, near the top:
RewriteEngine On
RewriteBase /modx-test/
Knowing all of the above, you should be able to troubleshoot almost any issue involving paths, for your MODX install. Without examining your environment directly, if I had to venture a wild guess, I'd say the setup script was run from inside a subfolder called manager
, so that was defined as the MODX_BASE_URL
. Subsequently those folders were moved so they no longer exist at the absolute path defined in the config.inc.php
file. That's only one possibility and I'm sorry if it's off-base. But again with the above info you should be able to spot the cause of the problem.