🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Baidu Cloud Virtual Host BCH Pseudo-Static Rules_Solving WordPress 404 Error

users who build websites with WordPressAfter setting pseudo-static rules, only the homepage is accessible, while all other pages are404 errorThis is caused by improperly configured server pseudo-static rules. This article introducesSolution for WordPress 404 errors on Baidu Cloud Virtual Host. If you are using a VPS and installedBaota PanelorLNMPone-click package, you can easily set pseudo-static rules when adding a website. However, if you are using Baidu Cloud Virtual Host BCH, the method to set pseudo-static is slightly more troublesome. Below is the method to configure WordPress pseudo-static for Baidu Cloud Virtual Host BCH; methods for other programs are similar.

Preparations

Baidu Cloud Virtual Host BCHThere are two methods to set pseudo-static: one is through the app.conf file, and the other is through the bcloud_nginx_gen.conf file. Naiba's recommendation is to use the second method, but both methods are introduced here.

app.conf

Please copy the code below and save it as an app.conf file
handlers:
    - url : /
    script : /index.php
    script : /index.html

    - rewrite_not_exist: (.*)
    script: /index.php/$1

    - errordoc : 404 /error/404.html

    - expire : .jpg modify 10 years
    - expire : .swf modify 10 years
    - expire : .png modify 10 years
    - expire : .gif modify 10 years
    - expire : .JPG modify 10 years
    - expire : .ico modify 10 years
It should be noted that the above rule customizes the 404 page to /error/404.html. If you want to use WordPress's default 404 page, delete this line. The file expire below is the file expiration time, default set to 10 years, which can be changed to 30 days. Reference:Baidu Cloud Help Documentation

bcloud_nginx_user.conf

Please copy the following code and save it as bcloud_nginx_user.conf
location / {

        try_files $uri $uri/ /index.php?$args;

}

# Add trailing slash to */wp-admin requests.

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

Specific method

After preparing the app.conf or bcloud_nginx_user.conf file, you can begin configuring the pseudo-static rules. The method is as follows: 1. Use FTP software to upload the app.conf or bcloud_nginx_user.conf file to the website root directory (upload only one of them, not both). 2. In the Baidu Cloud Virtual Host BCH control panel, find the site start/stop section, then click the button next to 'Reload Site Service'.百度云虚拟主机BCH3. Enter the WordPress site settings to configure pseudo-static and check the effect on the frontend. Up to this point,the pseudo-static configuration for Baidu Cloud Virtual Host BCHis complete. Video reference material:BCH Pseudo-Static Rule Configuration

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: