最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

migration - Transfer WP from subdomain to main domain

programmeradmin0浏览0评论

I've set up a redesign of a site in the subdomain to work out any kinks and to make sure everythings working ok before setting it up on the root domain. I've looked up transfers but have only found info on transfering from host to host or from local to host.

I've set up a wordpress site that was previously locally hosted, so I know how to transfer a site, I'm just hoping that there is an easier way to do this since this is transferring from subdomain to domain - like hopefully without having to reinstall wordpress...

Any solutions or suggestions welcome.

Thanks in advance.

I've set up a redesign of a site in the subdomain to work out any kinks and to make sure everythings working ok before setting it up on the root domain. I've looked up transfers but have only found info on transfering from host to host or from local to host.

I've set up a wordpress site that was previously locally hosted, so I know how to transfer a site, I'm just hoping that there is an easier way to do this since this is transferring from subdomain to domain - like hopefully without having to reinstall wordpress...

Any solutions or suggestions welcome.

Thanks in advance.

Share Improve this question asked Feb 28, 2011 at 17:54 user3498user3498 1
  • 1 If it's just a redesign, why not just copy the theme from the subdomain to the main domain? – Andy Commented Mar 30, 2011 at 19:46
Add a comment  | 

2 Answers 2

Reset to default 1

After copying to the main-directory change the values in then wp-config.php and .htaccess files for the new localtion. Then you have to change the values in the database. You need 3 SQL-Statements, which you can execute with phpMyAdmin for example.

First change the options-Table

UPDATE wp_options
SET option_value = replace(option_value, 'http://www.example/subdir', 'http://www.example')
WHERE option_name = 'home' OR option_name = 'siteurl';

Second change the values for the guid in the posts-table

UPDATE wp_posts
SET guid = replace(guid, 'http://www.example/subdir', 'http://www.example');

Third change the URL in the posts-Table

UPDATE wp_posts
SET post_content = replace(post_content, 'http://www.example/subdir', 'http://www.example');

If you have used another prefix then wp_ you have to change it in the 3 SQL-Statements. Pay attention at the example domain-names, too.

wordpress-support-moving-wordpress helped me, on a virtual machine running ubuntu, use the from existing server., i used the velvet plugin for url updating/re-write and seems to work maybe 1 or 2 broken images or attachments but it done 99% of the work.

发布评论

评论列表(0)

  1. 暂无评论