Home  >  Article  >  Backend Development  >  WordPress whole site moving summary_PHP tutorial

WordPress whole site moving summary_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:15:28912browse

Last year, the pictures were cheap and I wasn’t ready to seriously write blog posts, so I spent a few hundred yuan to buy a domestic space (the domain name has been registered). After purchasing it, I started a WordPress blog and wrote blog posts when I had free time, but I never took the time to write, and I didn’t pursue the quality of the articles. It was okay at first, because I don’t write often, I can accept that the blog cannot be accessed from time to time, I can accept that it can’t be pseudo-static, and I can accept that I can’t interact with social networking sites. In short, as long as the price is cheap, everything is acceptable. But in the first half of 2013, I started to want to write articles. When I visited the website, it often stopped working, sometimes for several days in a row, which was simply unbearable.

So when my space was about to expire, I decided to change my space. I searched online and found Taobao. I thought it would be easy to find a domestic space, after all, the domain name has been registered. But after two days of getting to know each other, I found that there were very few suitable ones.

Mainly related to domain name access issues. When changing the space, you also need to change the domain name registration access provider. To change the access provider , you need to know the password for domain name registration. I forgot my password, I changed my mobile phone, and my email address was my previous corporate email address.

So it is impossible to retrieve the password. If the password cannot be retrieved, the access provider cannot change it. I don’t want to use the original space, so I considered the space in Hong Kong and spent some time to understand it. Regarding the cost of Hong Kong space, I finally decided to choose Hong Kong vps, which is the vps currently used by 1100w.com, linux+apache+php+mysql.

After purchasing a vps, start backing up wordpress. The program is easy to back up, just drag it down through ftp. Then there is the database, because I used virtual space before, and when using the "backup database" function in the background, the backed-up database files always had problems during restoration. So I contacted customer service and directly said that I wanted the mysql database file. After a while, the customer service package was packaged and placed in the virtual space. Because I am currently using a Linux host, Windows files cannot be used under Linux.

So, I set up php+apache+mysql locally and backed up the files locally successfully. Then the database was restored successfully through phpmyadmin in the Linux management background.

After the database is restored successfully, upload the original wordpress file via ftp. After the upload is successful, modify the following places:

1.wp-config.php file, modify the database connection information

<span define</span>('DB_NAME', '数据库名'<span );
</span><span define</span>('DB_USER', '数据库用户名'<span );
</span><span define</span>('DB_PASSWORD', '数据库密码'<span );
</span><span define</span>('DB_HOST', 'localhost');

If the domain name is not changed, the website can be accessed successfully after modifying wp-config.php.

2. If you change the domain name, you need to modify the wp_options table in the database. Modify the fields siteurl and home in the table to the current domain name.

After WordPress is set up, the first task is to change similar connections like www.1100w.com/?p=613 into connections that are more conducive to SEO.

For example: http://www.1100w.com/jquery plug-in to implement web page rating function/

But the previous page needs to implement 301 jump, because after all, some articles still have some traffic and cannot be given up.

So I searched for wordpress 301 redirect from the Internet, and also tried several redirection plug-ins locally. I found that the settings are very troublesome. If you follow the official description, you need to add them one by one, which is impossible because the articles are relatively many.

Finally I found a solution, and it's very simple. I made a mistake at first.

The apache+wordpress environment can support the 301 redirect function very well. There is no need to install any plug-ins or set up .htaccess files.

Solution

We only need to select or set the connection we need in the WordPress background "Settings"->"Fixed Connection". WordPress automatically supports 301 redirection (I learned from the Internet that all new versions of WordPress support it, but I haven’t tested that version yet).

Instructions:

The reason why I didn’t use this method at the beginning was because I built a Windows 7+apache environment locally. After setting up the fixed connection, I found that the web page could not be opened. At the time, I did not think that it was because the rewrite module was not turned on. So we took a detour.

The solution is to open the httpd.conf file, find the following sentence, and remove the # sign in front of it.

#LoadModule rewrite_module modules/mod_rewrite.so.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440199.htmlTechArticleLast year the pictures were cheap and I wasn’t prepared to seriously write blog posts, so I spent a few hundred yuan to buy a domestic space ( The domain name has been registered). After purchasing it, I set up a wordpress blog, and when I have nothing to do...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn