The domain name of jingbo has been changed from essentialblog.cn to jingpin.org. The following describes how to change the domain name.
I. Operations on cpanel:
You can perform the following four steps on the cpanel of the Host:
Step 1: add additional domain names
Find the "Additional domain" option on the cpanel control panel and add your new domain name.
Step 2: Add a database
Generate a new database in the MySQL database.
Step 3: copy an object
To copy all WordPress files corresponding to the original domain name to the space of the new domain name, click "File Manager", select all WordPress files and folders corresponding to the original domain name, and click "copy ", enter the folder path corresponding to the new domain name and click "copy file (s )".
Step 4: Modify the wp-config.php File
Open the WordPress wp-config.php file corresponding to the new domain name through File Manager, change the old database to the new database, if the new database user name and password are different from the old database, you also need to modify.
2. phpMyAdmin operations
This is actually done on cpanel. to emphasize this, let's talk about it here.
Step 5: copy the database
On cpanel, click phpMyAdmin (the Chinese version of cpanel is translated into "phpmy management"), select the database of the original domain name, click "operation", and copy the database: in the "column, enter the new database name (full name, for example, young_jingpin), cancel the check box before" create database before copying ", and click" execute ".
Step 6: Modify the database
In phpMyAdmin, select the new database, click "SQL", and enter the followingCode:
- Update wp_options set option_value = replace ( option_value, 'HTTP: // www.essentialblog.cn ', 'HTTP: // jingpin.org' ) where option_name = 'home' or option_name = 'siteurl' ;
- Update wp_posts set post_content = replace ( post_content, 'HTTP: // www.essentialblog.cn ', 'HTTP: // jingpin.org' ) ;
- Update wp_posts set guid = replace ( guid, 'HTTP: // www.essentialblog.cn ', 'HTTP: // jingpin.org' ) ;
|
During the operation, change www.essentialblog.cn to your old domain name, and change jingpin.org to your new domain name.
After completing this step, you will see the Wordpress blog that is exactly the same as the original domain name when accessing the new domain name. However, after I completed the process, I found that all the pages except the home page could not be accessed. Later, under the guidance of hogogo, I took the following steps:
Step 7: Save the fixed link
Open the "Fixed Link" in the "Settings" option in the WordPress management background, and click "Save changes. This step is boring, but it cannot be less.
The above seven steps have actually completed one thing, that is, copying an identical Wordpress blog. After ensuring that all links to the new blog are normal, you need to redirect the old domain name to the blog of the new domain name so that when others access your old domain name, they will go to your new domain name blog, the procedure is as follows:
Step 8: 301 permanent redirection
Add the following code to the. htaccess file of the original Domain Name:
- Rewriteengine on
- Rewritecond %{Http_host}^ Www.essentialblog.cn
- Rewriterule(.*)HTTP:// Jingpin.org/1_1 [R = 301, l]
|
If you didn't. the htaccess file can copy and paste the above Code to the notepad, and "htaccess" is saved as the file name, and then uploaded to the root directory of the WordPress folder corresponding to the original domain name.
By the way, the ". htaccess" file corresponding to the original essentialblog.cn contains the following code:
- # Begin WordPress
- <Ifmodule mod_rewrite.c>
- Rewriteengine on
- Rewritebase/
- Rewritecond %{Request_filename}! -F
- Rewritecond %{Request_filename}! -D
- Rewriterule./index. php[L]
- </Ifmodule>
- # End WordPress
|
If you do not delete this code, you can jump to jingpin.org normally, but not to jingpin.org/aboutafter deleting the code. The. htaccess file on also has the following code:
- Rewritecond %{Http_host}^ Essentialblog.cn
- Rewriterule(.*)HTTP:// Www.essentialblog.cn/#1 [R = 301, l]
|
This code directs essentialblog.cn to www.essentialblog.cn, so that if someone accesses essentialblog.cn/about, they will also see jingpin.org/about instead of the 404 error page.
At this point, the entire domain name is replaced, and you can write a blog directly on the WordPress corresponding to the new domain name.