使用wordpress
的站点在更换绑定的域名后,登陆后台或前台都会有不能正常显示样式的情况。
解决办法
可通过修改数据表wp_options
和wp_posts
解决
以下以域名www.a.com
变更为www.b.com
为例
修改数据表wp_options
解决:
对应的option_name值为:site_url、home
对应的option_value值为站点域名,带http前缀
修改数据表wp_posts
(option_id = 1)
update wp_options set option_value = "http://www.b.com" where option_name = "siteurl";
(option_id = 33)
update wp_options set option_value = "http://www.b.com" where option_name = "home";
(更改网站内容数据表)
UPDATE wp_posts SET post_content=REPLACE(post_content, 'www.a.com', 'www.b.com');