When your Wordpress blog needs to change its domain name for some reason, you may be troubled by how to minimize the transfer cost or loss. The Wordpess blog is actually migrated, but it does not transfer the blog content.
When your Wordpress blog needs to change its domain name for some reason, you may be troubled by how to minimize the transfer cost or loss. It is not enough for a Wordpess blog to actually migrate its content. On the one hand, it must be expressed in the same content of another new domain name, and on the other hand, it must transfer the weight of the blog, transfer the traffic of the old domain name to the new domain name. There are two aspects to be done: one is the transfer of the content of the new and old Wordpress websites, and the other is the redirection of the old domain names.
(1) blog content transfer
1. First back up the database of the old blog, and then download and save all the files in the root directory of the old domain name, including folders, packaged and compressed into zip format.
Use ftp or online management tools to back up the plug-ins folder under the wp-content folder on your website and the themes under the theme folder. In addition, you can back up the uploads folder, which stores images and other content in your article.
In addition, it is to modify the wp-config.php file under the root directory, fill in the new database name, user name, password and Mysql host information.
If your root directory contains robbot.txt or other files that are not Wp itself, you can back up the file.
2. install a new blog. First, create a database in the new blog space (the database name and database username do not need to be the same as the original one ). Upload the zip package in the first step, in the new domain name space to unzip the installation, after decompression, find the wp-config.php file directly deleted. Enter the new domain name in the browser to install Wordpress, and enter the database in step 1. After a new blog is created, it is just a new blog without any data and then imported into the database of the old blog.
3. there are many ways to import databases to the old blog. I have implemented this by using the wordpress database backup tool. After the import is complete, check the new domain name. you will find that all the previous content has been transferred, but the old domain name in the content has not been changed or the URl of the old domain name. Go to Phpmy management, select the database of your new blog, and then select "wp-options" in the database.
Click edit to change siteurl to a new domain name.
After saving it, go back to the new website and refresh it. basically, all the URLs are changed to new ones. At this time, the link in the upper left corner of the wordpress logon background is still the old domain name. you must log on to the new wordpress background and change the url to a new url in the basic settings. At this time, all the original wordpress content is transferred.
Now, the implementation is the same as that of the original blog.
(2) use 301 redirection to redirect old domain names to new domain names
Using 301 redirection, you can gradually shift the weight of the original website in the search engine and the ranking of the old domain name in the search engine. However, this requires a process.
301 there are also many redirection methods. here we will introduce how to set the wordpress. htaccess file. If the wordpress root directory does not have this file, you can manually create a. htaccess file. Open the. htaccess file and edit it. the following uses the old domain name www.lijiliang.cn to direct to www.php900.com as an example:
RewriteEngine On
RewriteCond % {HTTP_HOST }! ^ Www.php900.com $ [NC]
RewriteRule ^ (. *) $ http://www.php900.com/#1 [L, R = 301]
RewriteEngine On
RewriteCond % {HTTP_HOST }! Www.lijiliang.cn $ [NC]
RewriteRule ^ (. *) $ http://www.php900.com/#1 [L, R = 301]
In this way, the old domain name can jump to the new domain name one-to-one, whether on the home page or on the internal page. In addition, the weight of the old domain name is gradually transferred to the new domain name after a period of time.
The above site has been implemented and is completely feasible. I hope it will help you.