【发布时间】:2016-03-16 04:02:43
【问题描述】:
我正在开展一个项目,该项目涉及将 WordPress 安装从 A 点迁移到 B 点。这应该相当简单,但是手动或基于插件的传输都不起作用。解释:
A 点是“demo.com”的一个相当标准的安装,我正在尝试将它迁移到一个子域(B 点),比如“c.example.com”。当然,我可以很好地迁移代码、插件、主题等,但是当我带来数据库时,一切都变得混乱(并且我已经更新了站点 URL / 主页 URL / 数据库中的一些永久链接结构)。
<head> 标记内的一段代码显示了一些有趣的信息:
<link rel="stylesheet" id="parent-style-css" href="http://c.#wp-content/themes/Example_theme/style.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="style-css-css" href="http://c.#wp-content/themes/Example_theme/style.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="layout-css" href="http://c.#wp-content/themes/Example_theme/css/layout.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="main-css" href="http://c.#wp-content/themes/Example_theme/css/main.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="shortcodes-css" href="http://c.#wp-content/themes/Example_theme/css/shortcodes.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="mediaelement-css" href="http://c.#wp-includes/js/mediaelement/mediaelementplayer.min.css?ver=2.18.1" type="text/css" media="all">
<link rel="stylesheet" id="prettyPhoto-css" href="http://c.#wp-content/themes/Example_theme/css/prettyPhoto.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="responsive-css" href="http://c.#wp-content/themes/Example_theme/css/responsive.css?ver=4.4.2" type="text/css" media="all">
<link rel="stylesheet" id="instag-slider-css" href="http://c.#wp-content/plugins/instagram-slider-widget/assets/css/instag-slider.css?ver=1.2.1" type="text/css"
仔细看,你可以看到href/path不包含'example.com'域名,而是用“#”代替。
http://c.#wp-content/themes/Example_theme/css/responsive.css?ver=4.4.2
进一步说明,我已更新 wp-config 文件以定义 WP_HOME 和 WP_SITE URL,但这没有任何效果。 .htaccess 也针对子域进行了更正(另外没有效果),它显示:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /c/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . //index.php [L]
</IfModule>
# END WordPress
原因似乎是在数据库中的某个地方,但是可能有一个文件在某个地方控制它。
欢迎任何帮助,非常感谢。
再次感谢您抽出宝贵时间解决我的问题。
【问题讨论】:
标签: mysql wordpress .htaccess config