将Modx站点从子文件夹移动到 [英] Move modx site from subfolder to root folder

查看:107
本文介绍了将Modx站点从子文件夹移动到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在共享文件夹的根文件夹(即public/www/)中运行了一个MODX站点.
我还在子文件夹(public/www/modxtest)中运行了一个MODX测试站点.

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).

我想将此测试站点移到根目录中,以使根文件夹中的modx站点在迁移结束之前不受影响.

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.

我以前没有接触过MODX,也不知道迁移过程.

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

一种实现方法是使用htaccess文件,然后将请求重定向到根MODX站点,并将其重定向到子文件夹MODX站点,如 https://my.bluehost.com/cgi/help/347

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

此方法可能会使其他人感到困惑,因为他们不知道会发生这种重定向,并且可能碰巧删除了以"test"为前缀的子目录.

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?

预先感谢

推荐答案

您没有指定要使用的Modx版本,但我认为它是Revo.

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

移动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. 将所有文件移到正确的目录.
  2. 在modx根目录中打开config.core.php.在此处输入新路径
  3. 打开core/config/config.inc.php并更改所有路径和相对URL以匹配您的新文件夹/URL.
  4. setup文件夹上载到您的modx根目录.如果没有此文件夹,请从modx.com下载该文件夹:注意:切记为您的Modx版本上载安装文件夹,因为其中可能包含更改.上传错误的设置可能会导致您的Modx崩溃.您可以在Manager面板中检查当前的Modx版本.在移动所有文件之前执行此操作.
  5. 运行安装程序(选择现有站点).
  6. 全部完成.
  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.

要找到完整的路径,此PHP脚本应具有魔力:

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

<?php
echo dirname(__FILE__);
?>

将其放置在Modx根目录中.这将是您的根路径.

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

这应该是一种防弹的好方法,但是请记住备份所有文件,并在更改路径和URL时要小心.

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.

这篇关于将Modx站点从子文件夹移动到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆