Home Backend Development PHP Tutorial WordPress whole site moving summary_PHP tutorial

WordPress whole site moving summary_PHP tutorial

Jul 20, 2016 am 11:15 AM
wordpress indivual Prepare domestic picture Summarize move place

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');
Copy after login

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 of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

What are the plugins for wordpress blocking ip What are the plugins for wordpress blocking ip Apr 20, 2025 am 08:27 AM

WordPress IP blocking plugin selection is crucial. The following types can be considered: based on .htaccess: efficient, but complex operation; database operation: flexible, but low efficiency; firewall: high security performance, but complex configuration; self-written: highest control, but requires more technical level.

How to build a website for wordpress host How to build a website for wordpress host Apr 20, 2025 am 11:12 AM

To build a website using WordPress hosting, you need to: select a reliable hosting provider. Buy a domain name. Set up a WordPress hosting account. Select a topic. Add pages and articles. Install the plug-in. Customize your website. Publish your website.

How to change the head image of the wordpress theme How to change the head image of the wordpress theme Apr 20, 2025 am 10:00 AM

A step-by-step guide to replacing a header image of WordPress: Log in to the WordPress dashboard and navigate to Appearance &gt;Theme. Select the topic you want to edit and click Customize. Open the Theme Options panel and look for the Site Header or Header Image options. Click the Select Image button and upload a new head image. Crop the image and click Save and Crop. Click the Save and Publish button to update the changes.

How to cancel the editing date of wordpress How to cancel the editing date of wordpress Apr 20, 2025 am 10:54 AM

WordPress editing dates can be canceled in three ways: 1. Install the Enable Post Date Disable plug-in; 2. Add code in the functions.php file; 3. Manually edit the post_modified column in the wp_posts table.

How to write a header of a wordpress How to write a header of a wordpress Apr 20, 2025 pm 12:09 PM

The steps to create a custom header in WordPress are as follows: Edit the theme file "header.php". Add your website name and description. Create a navigation menu. Add a search bar. Save changes and view your custom header.

What to do if there is an error in wordpress What to do if there is an error in wordpress Apr 20, 2025 am 11:57 AM

WordPress Error Resolution Guide: 500 Internal Server Error: Disable the plug-in or check the server error log. 404 Page not found: Check permalink and make sure the page link is correct. White Screen of Death: Increase the server PHP memory limit. Database connection error: Check the database server status and WordPress configuration. Other tips: enable debug mode, check error logs, and seek support. Prevent errors: regularly update WordPress, install only necessary plugins, regularly back up your website, and optimize website performance.

How to display wordpress comments How to display wordpress comments Apr 20, 2025 pm 12:06 PM

Enable comments in WordPress website: 1. Log in to the admin panel, go to "Settings" - "Discussions", and check "Allow comments"; 2. Select a location to display comments; 3. Customize comments; 4. Manage comments, approve, reject or delete; 5. Use &lt;?php comments_template(); ?&gt; tags to display comments; 6. Enable nested comments; 7. Adjust comment shape; 8. Use plugins and verification codes to prevent spam comments; 9. Encourage users to use Gravatar avatar; 10. Create comments to refer to

See all articles