Reputation: 369
I was developing a wordpress site on a subdomain and now I'm ready to place it on the main domain. However I'm having trouble doing this. I was following the instructions at: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install
But the problem comes when I'm supposed to rewrite the <?php require('/wp-blog-header.php'); ?>
If I change it to <?php require('_sub/wc/wp-blog-header.php'); ?>
it gives me error: require() [function.require]: Failed opening required '/home/tr006600/www_root../_sub/wc/wp-blog-header.php' (include_path='.:/usr/share/pear/') in /home/tr006600/www_root/index.php on line 17.
I think the problem is that at my provider, the subdomain folder isn't located inside the www_root, but is a totally separate folder. I've also tried this <?php require('http://wc.example.com/wp-blog-header.php'); ?>
but didn't solve the problem either.
Any ideas how to fix this issue, please?
Upvotes: 0
Views: 73
Reputation: 619
Next time you want to move a WordPress site, you can consider using a WordPress plugin to handle the job for you.
There is several plugins that can do this for you.
Check this one : Golive
GoLive Features:
Automatically Export the Database from Source Server
Transfering the files via FTP automatically
Update wp-config.php file on destination server with the new credentials.
Replace the URLs in Database (Posts, Pages, Menus…), and keep auto-update serialized objects too.
Upvotes: 0
Reputation: 1597
Treat the install as its own site and as a separate domain. Basically what you want to do is copy all of the files in the sub domain to the root domain and update the DB to change the URLs in the setting and posts/pages. Below are the MySQL queries you want to run if you are using the default table prefix.
UPDATE wp_options SET option_value = replace(option_value, 'http://sub.domain.com', 'http://www.domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://sub.domain.com', 'http://www.domain.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://sub.domain.com', 'http://www.domain.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'src="http://sub.domain.com', 'src="http://www.domain.com');
UPDATE wp_posts SET guid = REPLACE (guid, 'http://sub.domain.com', 'http://www.domain.com') WHERE post_type = 'attachment';
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://sub.domain.com','http://www.domain.com');
More information here: http://codex.wordpress.org/Changing_The_Site_URL & http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change
Upvotes: 1