Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm going to move my blog from http://blog.wordfruit.com to http://wordfruit.com/blog

the main Wordfruit site is in PHP and the blog is WordPress.

I know I can make the change at wp-admin/options-general.php

...I want to make sure I don't create problems when I make that change...

  1. Do I not need to create any folders etc on the domain? Will they just create themselves when I make the change?

  2. Can I redirect the old urls to the new urls from within the WordPress account?

  3. Are there any other things I need to account for in making this change?

Cheers, Richard

share|improve this question
    
This: codex.wordpress.org/Moving_WordPress has some useful info. –  Elliott Sep 14 '11 at 8:12
add comment

2 Answers

up vote 4 down vote accepted

First you should read the Codex entry on domain moving http://codex.wordpress.org/Moving_WordPress

But in a nutshell: aside from moving your contents phisically to the /blog location, all you have to do is search and replace every SQL entry for the previous domain (instead of just changing the domain in Wordpress options). Doing this by hand is pretty dangerous, I found this script to be very helpful: http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

Backup your database (eg. with PHPMyAdmin) in SQL form, then upload the above php script to your host folder, and point your browser to it. Using it you can safely search & replace http://blog.wordfruit.com to http://wordfruit.com/blog.

All your post contents and options will be then rewritten to the new domain. What possibly could remain is your page template - if you made it yourself, I'd also download and search the contents the theme folder for possible hard links to the old domain.

share|improve this answer
add comment

I have played with those options myself and would recommend doing this instead.

  1. Copy all physical files to new location and delete wp-config.php
  2. Use a back up plugin and export all content and options
  3. Install the new blog on a new database or with a new prefix
  4. Import all of the content and settings back into WordPress
  5. Check that everything is working on the new site
  6. If everything is working delete the old sites database and files
  7. Redirect the old sites domain to the new location

I know this seems strange given the settings but whenever I used the change domain settings it didn't work and it broke the site, I then had to manually change it back through wp_config.php.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.