WordPress change space for domain name practice experience

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Ox Blog intends to move, but also change space for domain name and change the theme. For WordPress blog, PHP program code, the author of the same look not too clear, can be said to be a rookie. Web search about WordPress Moving tutorials is still quite a lot, but in the course of other people's course, always will suddenly appear new problems to face. Therefore, the author on the actual sharing is how to explore the solution.

I used the host is a Windows host, I was moving the site to their own local test changes and then moved to buy new space, I use the local environment software: Wampserver. First in the local test, the modification is no problem, I believe it is not difficult to move to other hosts. For the WordPress change space for the domain name, the first solution is that you change the space first or change the domain name first? is to change the space first, the website program and database are put into the new space. Below, to say the specific steps:

1,wordpress plugin shutdown, Web site program package download, SQL database Information export

This is the preparation phase, especially the WordPress plugin shutdown, the proposed move in the process of first off, lest the program in the new space to enable unexpected. and the website program package download, SQL database Information export These two points, the general space backstage all have the management function, the entire station program all downloads to the local computer.

2, to resolve the new domain name, the Web site program upload new space, modify the database connection information

Resolve the new domain name, this you can not do it yourself, directly let the space merchants to help you solve the line. General website program upload directly upload rar package, and then use the space back management decompression will be more rapid insurance. Program source code upload, of course, to upload database information, in the database management phpMyAdmin Import database, but many database import requirements small and 2M, this you can contact your space provider to help solve, if it is in the local, you can see my tutorial notes below. and modify the database information, you can through the DW, modified to your new database name, host name and password, this information and you import the database when you add the user information consistent. Modify the database parameters associated with the wp-config.php file in the root directory of the Web site, as shown below:

/** WordPress Database Name * *

Define (' db_name ', ' Your database name ');

/** MySQL Database Username * *

Define (' Db_user ', ' Your database username ');

/** MySQL Database Password * *

Define (' Db_password ', ' Your Database password ');

/** MySQL Host * *

Define (' db_host ', ' localhost ');

Fill in your new host space database name, database username and password. Note that MySQL host this default is ' localhost ', if you are a Windows host, do not have to modify, if it is a Linux host, you need to fill in the address of the database.

3, temporarily delete the. htaccess file, modify the database information change the domain name

Because a lot of WordPress has set up pseudo static rules, so after the program upload temporarily delete. htaccess file, this is easy to ignore, and lead to clear all the details are set up, access is to jump 404 of the situation. Change the website domain name, this needs to change the database information to start, must enter the database management phpMyAdmin to revise.

Login to phpMyAdmin, select your blog's database, and then click SQL to enter the following four line 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 ');

UPDATE wp_posts SET GUID = replace (GUID, ' aaa.com ', ' bbb.com ');

of which, AAA. COM is your old domain name, and bbb.com is the new domain name. Also note that many people ignore the fourth sentence. And if your database header is not the default WP start, you have to modify the header of your own database, many people forget this point. Not only these four sentences, because each topic is different, perhaps you also want to revise other table's information, you best look each one.

4, login to the Web site to modify the Web site, re-open Plug-ins

The above three steps, you already can use the new website to browse the site, the website program already and the database connection is smooth, then you want to go to WordPress backstage revise default website URL, login to its WordPress console, find "set"-> "General", Then the WordPress address and the old domain name in the blog address, replace with the new domain name.

5, add modified. htaccess file, set 301 Turn

WordPress Blog After moving the best web structure, static settings are consistent, in order to facilitate the setting of 301 turn, the original search engine can be included in the URL to the new Web site to avoid weight loss. As for these two steps, you can also let the space provider to help you set up, or online to find tutorial settings.

Note:

The author in the process of changing the domain name, because it is in the local test, but also encountered the following problems, by the way the solution:

1,phpmyadmin Import Database file maximum limit of 2048KB modification:

Solution: Open php.ini, find upload_max_filesize, and change the value to larger.

2, when the local test, through localhost access to the Web site generated internal Server error prompts:

Solution: The culprit for this error is static files. htaccess, the solution is to kill the static file, such as named 1.htaccess, or move to another folder, or even deleted, later to use the time to move out.

3, blog theme error, show "Parse error:syntax error, unexpected t_endif in E:\aa\wamp\www\wordpress\wp-content\themes\xiaohan\ sidebar.php on line 104 "similar hints.

Solution: Do you see the 89th line of siderbar.php <? }?> <? }?> to < php}? >.

(Ox Blog: http://guoxun211.com/original production, reproduced please indicate the source, thank you!)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.