Move modx site from subfolder to root folder

别来无恙 提交于 2019-12-13 12:22:57

问题


I have an MODX site running on the shared server in the root folder (i.e. public/www/).
I also have an MODX testing site running in the subfolder (public/www/modxtest).

I want to move this testing site into the root in a way that the modx site in root folder is not affectetd until the end of migration.

I haven't touched MODX before and do not know the migration procedure.

One way of doing that may be using htaccess file and redirect the request to the root MODX site to the subfolder MODX site as in https://my.bluehost.com/cgi/help/347

This method might get confusing for other person as they wouldn't know this redirection happening and might happen to delete the subdirectory as prefixed 'test'.

What could be the better and reliable way for complete migration from subfolder to the root folder?

Thanks in advance


回答1:


You don't specify which version of Modx you are using, but I assume it is Revo.

Moving a Revo-site can be difficult, but I've done it several times, so I've made a simple list over things that I have to do.

  1. Move all the files to the right directory.
  2. Open config.core.php in the modx-root. Enter your new path here
  3. Open core/config/config.inc.php and change all the paths and relative urls to match your new folder/url.
  4. Upload the setup-folder to your modx-root. If you don't have this folder, download it from modx.com: NOTE: Remember to upload the setup-folder for YOUR version of Modx as these may include changes. Uploading wrong setup may cause your Modx to crash. You can check your current Modx-version in your Manager-panel. Do this before moving all your files.
  5. Run the setup (select existing site).
  6. All done.

To find your full path, this PHP-script should do the magic:

<?php
echo dirname(__FILE__);
?>

Place this in the Modx-root. This will be your root-path.

This should be a pretty bulletproof way to do it, but remember to take backup of all your files and be careful when changing paths and urls.




回答2:


Thanks for your answer OptimusCrime. Just followed the steps and all was well apart from the RewriteBase in the .htaccess file.

To resolve this:

3(a). Open .htaccess and change the RewriteBase, if present, from the old root to the new root.

For example: Change RewriteBase /old-modx-root/ to RewriteBase /new-modx-root/



来源:https://stackoverflow.com/questions/13556466/move-modx-site-from-subfolder-to-root-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!