search
HomeBackend DevelopmentPHP TutorialWordPress whole site moving summary_PHP tutorial

WordPress whole site moving summary_PHP tutorial

Jul 20, 2016 am 11:15 AM
wordpressindivualPreparedomesticpictureSummarizemove 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');

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
How does PHP identify a user's session?How does PHP identify a user's session?May 01, 2025 am 12:23 AM

PHPidentifiesauser'ssessionusingsessioncookiesandsessionIDs.1)Whensession_start()iscalled,PHPgeneratesauniquesessionIDstoredinacookienamedPHPSESSIDontheuser'sbrowser.2)ThisIDallowsPHPtoretrievesessiondatafromtheserver.

What are some best practices for securing PHP sessions?What are some best practices for securing PHP sessions?May 01, 2025 am 12:22 AM

The security of PHP sessions can be achieved through the following measures: 1. Use session_regenerate_id() to regenerate the session ID when the user logs in or is an important operation. 2. Encrypt the transmission session ID through the HTTPS protocol. 3. Use session_save_path() to specify the secure directory to store session data and set permissions correctly.

Where are PHP session files stored by default?Where are PHP session files stored by default?May 01, 2025 am 12:15 AM

PHPsessionfilesarestoredinthedirectoryspecifiedbysession.save_path,typically/tmponUnix-likesystemsorC:\Windows\TemponWindows.Tocustomizethis:1)Usesession_save_path()tosetacustomdirectory,ensuringit'swritable;2)Verifythecustomdirectoryexistsandiswrita

How do you retrieve data from a PHP session?How do you retrieve data from a PHP session?May 01, 2025 am 12:11 AM

ToretrievedatafromaPHPsession,startthesessionwithsession_start()andaccessvariablesinthe$_SESSIONarray.Forexample:1)Startthesession:session_start().2)Retrievedata:$username=$_SESSION['username'];echo"Welcome,".$username;.Sessionsareserver-si

How can you use sessions to implement a shopping cart?How can you use sessions to implement a shopping cart?May 01, 2025 am 12:10 AM

The steps to build an efficient shopping cart system using sessions include: 1) Understand the definition and function of the session. The session is a server-side storage mechanism used to maintain user status across requests; 2) Implement basic session management, such as adding products to the shopping cart; 3) Expand to advanced usage, supporting product quantity management and deletion; 4) Optimize performance and security, by persisting session data and using secure session identifiers.

How do you create and use an interface in PHP?How do you create and use an interface in PHP?Apr 30, 2025 pm 03:40 PM

The article explains how to create, implement, and use interfaces in PHP, focusing on their benefits for code organization and maintainability.

What is the difference between crypt() and password_hash()?What is the difference between crypt() and password_hash()?Apr 30, 2025 pm 03:39 PM

The article discusses the differences between crypt() and password_hash() in PHP for password hashing, focusing on their implementation, security, and suitability for modern web applications.

How can you prevent Cross-Site Scripting (XSS) in PHP?How can you prevent Cross-Site Scripting (XSS) in PHP?Apr 30, 2025 pm 03:38 PM

Article discusses preventing Cross-Site Scripting (XSS) in PHP through input validation, output encoding, and using tools like OWASP ESAPI and HTML Purifier.

See all articles

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

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment