我在子域上开发了一个wordpress站点,现在我准备把它放在主域上。不过,我在做这件事上有困难。我是按照安装的指示执行的
但是,当我将<?php require('/wp-blog-header.php'); ?>更改为<?php require('_sub/wc/wp-blog-header.php'); ?>时,问题就出现了,它在/home/tr006600/www_root/index.php第17行中给出了错误: required () function.require: Failed <?php require('_sub/wc/wp-blog-header.php'); ?>(include_path=.:/usr/share/pear/‘)。
我认为问题在于,在我的提供程序中,子域文件夹不是位于www_root内部,而是一个完全独立的文件夹。我也尝试过这个<?php require('http://wc.example.com/wp-blog-header.php'); ?>,但也没有解决问题。
请问有什么办法解决这个问题吗?
发布于 2014-06-02 21:15:28
将安装视为自己的站点和单独的域。基本上,您要做的是将子域中的所有文件复制到根域,并更新DB以更改设置中的URL和posts/页面。下面是使用默认表前缀时要运行的MySQL查询。
UPDATE wp_options SET option_value = replace(option_value, 'http://sub.domain.com', 'http://www.domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://sub.domain.com', 'http://www.domain.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://sub.domain.com', 'http://www.domain.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'src="http://sub.domain.com', 'src="http://www.domain.com');
UPDATE wp_posts SET guid = REPLACE (guid, 'http://sub.domain.com', 'http://www.domain.com') WHERE post_type = 'attachment';
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://sub.domain.com','http://www.domain.com');更多信息请参阅:URL & 变化
发布于 2014-06-17 13:14:53
下次要移动WordPress站点时,可以考虑使用WordPress插件来处理工作。
有几个插件可以为你做到这一点。
检查这个:Golive
GoLive特性:
https://stackoverflow.com/questions/24003088
复制相似问题