In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Option one
Not a few friends who set up personal blogs use WordPress, so it is inevitable to change the space and domain name. Since the author personally experienced the situation of changing the space and domain name, changing the blog from AAA.com to BBB.com, this article will share a better way to change the domain name.
WordPress everyone knows that the background needs to set the default URL of the website, if the domain name is changed directly, it is impossible to log in with the new domain name. There are many articles on the Internet, telling you that you can modify the MySQL database, or modify WordPress's wp-config.php file or function.php file, etc., in fact, it is not so troublesome.
As long as the domain names before and after the replacement are in their own hands, then the solution is actually very simple. First of all, let the domain names before and after the change are resolved to the blog space, that is, so that both the new and old domain names can access the blog correctly. To determine whether both new and old domain names can be accessed correctly, in addition to the correct access to both local and local domain names, you also need to check whether domain name access in other regions is normal, because the effective time of DNS in China Telecom, China Unicom and different regions is different. At this time, the webmaster's home has a better tool to use, that is, super ping (http://ping.chinaz.com). Enter the new and old domain names into the super ping to see if ping can be connected everywhere.
Log in to the WordPress background with the administrator, click set → routine, modify the WordPress address (URL) and site address (URL) into the new domain name, and then click Save changes. Hey, I quit, in fact, it is a success, to see if the browser's address bar has become a new address? Log in with your administrator account to see if it has become a new domain name in the regular setting of →. Then click on the home page to see if it has become a new domain name, and if you enter the old domain name, will it jump to the new domain name? It is obvious that the modification has been successful, isn't it very simple?
However, as some of the links and image addresses in the blog posts are still using the old domain names, some changes need to be made.
Log in to phpmyadmin, select the database of your blog, click SQL, and enter the following three lines of commands:
UPDATE wp_posts SET post_content = replace (post_content, 'AAA.com','BBB.com')
UPDATE wp_comments SET comment_content = replace (comment_content, 'AAA.com',' BBB.com')
UPDATE wp_comments SET comment_author_url = replace (comment_author_url, 'AAA.com',' BBB.com')
Then click execute, and if there are no errors, all addresses in the articles and comments will be changed.
At this time, visit it with a new address, and the domain name will be changed perfectly.
Option 2
Step 1: back up all files in the root directory of the website and transfer them to the new host
Step 2: back up the website database file and set up the database on the new host for import
Step 3: modify the wp-config.php file to ensure that the website file communicates with the database properly
Step 4: bind the domain name to the new host and resolve the domain name to the host.
Step 5: change the URL in the database.
The first step of wordpress move: back up all the files in the root directory of the website
Method 1. You can directly ftp all the files down the URL directly.
Method 2. This wordpress plug-in BackUpWordPress can back up website files and databases and package them, which is very convenient and is recommended.
Wordpress move step 2: back up the data table and export, establish the database name in the new host database, and import the data table
There are two common ways to back up data tables, one is to find database management in the old host and export the data table to sql format (generally default is this); the other is to install the "WordPress Database Backup" plug-in on the wordpress blog and export the data table through the plug-in (it is strongly recommended to install this plug-in, which can automatically back up data on a regular basis, which is more secure). The plug-in installation method is not described here. After exporting the data table in Sql format, you need to log in to the database management interface of the new host and establish a new database. The database name can be arbitrary, preferably the same as the old one. Find the import option after the database is established, and import the previously exported data table into the database.
Wordpress move step 3: modify the wp-config.php file to make the communication between the website file and the database normal
To let the website file communicate with the database normally, you need to tell the website file, what is the database user name you want to use, what is the password, the website file can get the database information, and then tell the website file, what is your database name? let it find the corresponding data table, so that it can maintain normal communication. As follows:
/ * * name of WordPress database * /
Define ('DB_NAME',' the name of your new database')
/ * * MySQL database user name * /
Define ('DB_USER',' your database user name, which can be found in the host database information')
/ * * MySQL database password * /
Define ('DB_PASSWORD',' your database password, which is also found in the host information')
/ * * MySQL host * /
Define ('DB_HOST','localhost')
Only the first three items need to be changed, and the others are generally not modified.
Wordpress move step 4: bind the domain name and domain name resolution on the new host
This is very simple, so I won't say much about it.
Step 5 of wordpress's move: change the URL in the database.
Open your database, click SQL, and paste the following code into the box. Click execute.
UPDATEwp_optionsSEToption_value = replace (option_value,' http://www.old.com','http://www.new.com')WHEREoption_name = 'home'ORoption_name =' siteurl'
UPDATEwp_postsSETpost_content = replace (post_content,' http://www.old.com','http://www.new.com')
UPDATEwp_postsSETguid = replace (guid,' http://www.old.com','http://www.new.com')
Modify the database. Find the corresponding website database and modify the wp-options and wp-posts files. Replace all the old domain names with new ones. Note that the first file requires two changes: siteurl and home.
In this way, the move is completed, and you can record it after testing, which is convenient for later use.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.