在 abc.com 域名下建了一个wordpress站,在abc.com/def 下也建了一个wordpress站。
现在想把abc.com/def 移动到 abc.com 下作为主站,即打开 abc.com后访问的是原 abc.com/def 下的内容。
请教如何操作?
回复内容: 在 abc.com 域名下建了一个wordpress站,在abc.com/def 下也建了一个wordpress站。
现在想把abc.com/def 移动到 abc.com 下作为主站,即打开 abc.com后访问的是原 abc.com/def 下的内容。
请教如何操作?
只需移动一个文件:
把 def 目录下的 index.php 移到根目录下,即 abc.com 访问到的目录,并确保打开 abc.com 就是打开index.php,而不是index.html;将根目录下的 index.php 中的:
require( dirname( __file__ ) . '/wp-blog-header.php' );
改成:
require('./def/wp-blog-header.php');在 def/wp-config.php 中添加以下代码:
define('wp_home', 'http://abc.com');
define('wp_siteurl', 'http://abc.com/def');
define('cookie_domain', 'abc.com');
define('wp_content_url', 'http://abc.com/def/wp-content');
define('wp_plugin_url', 'http://abc.com/def/wp-content/plugins');
吧所有文件移动到webroot下面修改.htaccess修改db url记录