2010年01月21日 Thursday , 407 次点击

第一次换域名,花在查资料上的时间远比实际用的时间多,感谢总统,感谢Google,新域名总体上顺利地接替了原来的CN域名。以下是我这次更换域名的步骤:

1、修改新域名的A记录,只是更新一下新域名默认的A记录值,去他爹的域名管理工具很人性化,常用的CNAME基本上都有了。此为域名的解析。

2、进入主机的CPanel,添加一个附加域,此为域名的绑定。

3、使用WordPress Database Backup插件备份数据库。

4、进入Wordpress后台,修改用户的URL地址、“Wordpress安装地址”和“博客地址”。

5、进入主机的phpMyAdmin,更新各表数据:

SQL:
  1. --替换文章中的内部链接,若文章内容中有原域名,这样的替换会连文章内容中的域名一并替换掉,所以平时在文章中写当前的域名时要做些手脚,免得将来更换域名时替换掉
  2. UPDATE wp_posts SET post_content=REPLACE(post_content,'http: //www.leninlee.cn','http: //sinolog.it');
  3. UPDATE wp_posts SET post_content=REPLACE(post_content,'http: //leninlee.cn','http: //sinolog.it');
  4. --替换文章的永久链接
  5. UPDATE wp_posts SET guid=REPLACE(guid,'http: //www.leninlee.cn','http: //sinolog.it');
  6. UPDATE wp_posts SET guid=REPLACE(guid,'http: //leninlee.cn','http: //sinolog.it');
  7. --替换评论中的链接
  8. UPDATE wp_comments SET comment_author_url=REPLACE(comment_author_url,'http: //www.leninlee.cn','http: //sinolog.it');
  9. UPDATE wp_comments SET comment_author_url=REPLACE(comment_author_url,'http: //leninlee.cn','http: //sinolog.it');
  10. UPDATE wp_comments SET comment_content=REPLACE(comment_content,'http: //www.leninlee.cn','http: //sinolog.it');
  11. UPDATE wp_comments SET comment_content=REPLACE(comment_content,'http: //leninlee.cn','http: //sinolog.it');

6、301永久重定向,将使用原域名对本站的访问都转移到新域名,尤其对搜索引擎优化有益。在主机支持.htaccess的前提下,修改Web根目录下的.htaccess文件,加入如下内容:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^leninlee.cn [NC,OR]
RewriteCond %{HTTP_HOST} ^www.leninlee.cn [NC]
RewriteRule ^(.*)$ http://sinolog.it/$1 [L,R=301]

Tags :

随机日志

來留言吧!


Please copy the string qOWpB1 to the field below:

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

4 個留言

cn域名相当恶梦,换了好。我也按照飞鸽传书与时惧进地响应,更换了链接,哦野

 

更新了,幸亏我转出的早,呵呵。。。

 

我最近也换了域名,更严重的是系统由原来的WP换成了自己写的。最严重的是国内的搜索引擎们包括百度都不知道301跳转是咋回事。

国内的搜索引擎全部可以无视,我博客的流量从来都是Google贡献绝大部分,我也从来不百度。

早就看见你博客换程序了,加油啊。

 
 

留言板RSS 引用 URI

來留言吧!

«
»