WordPress 網站更換域名步驟
第一 把之前的代碼打包放在編輯器里面直接源碼替換
然后就是數據庫 替換
第一 前面是 xxxxxx.com 舊的域名 后面 是新的域名xxxxxx.cn
UPDATE wp_options SET option_value = REPLACE(option_value, 'xxxxxx.com', 'xxxxxx.cn') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = REPLACE(post_content, 'xxxxxxx.com', 'xxxxxxxcn');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'xxxxxxx.com', 'xxxxxx.cn');
第二個數據庫替換
UPDATE wp_options SET option_value = REPLACE(option_value, '/www/wwwroot/xxxxxxx.com', '/www/wwwroot/xxxxxxxcn');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '/www/wwwroot/xxxxxxx.com', '/www/wwwroot/xxxxxxxcn');
最后替換下數據庫的賬戶 和密碼 偽靜態弄好基本就ok了。
WordPress 修改數據庫賬戶密碼是在根目錄下
wp-config.php 這個文件

浙公網安備 33010602011771號