Baidu Cloud Virtual Host Pseudostatic

Baidu Cloud virtual host BCH pseudo static rules_resolving WordPress404 error

Use WordPress to build a website After setting the pseudo static rules, all the other pages are 404 error , which is caused by the failure to configure the pseudo static rules of the server. Introduction Baidu Cloud Virtual Host WordPress404 Error Resolution

If you are using VPS, then install it to Pagoda panel perhaps LNMP One click package can easily set pseudo static rules when you add a website. However, if you use Baidu Cloud virtual host BCH, it will be a little troublesome to set the pseudo static method. The following is the method of configuring WordPress pseudo static for Baidu Cloud virtual host BCH. Other program methods are similar.

preparation in advance

Baidu Cloud Virtual Host BCH There are two ways to set pseudo static, one is through the app.conf file, the other is through the bcloud_nginx_gen.conf file.

The second method is recommended by the father, but both methods are introduced here.

app.conf

Please copy the following code 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

Note that the above rule defines 404 pages, which is/error/404.html. If you want to use the default 404 page of WordPress, delete this line.

The following file expiration is the expiration date of the file. The default setting is 10 years, which can be changed to 30 days

reference material: Baidu Cloud Help Document

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 methods

After preparing the app.conf or bcloud_nginx_user.conf file, you can start to configure 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 root directory of the website (only upload any one, not all)

2. Baidu Cloud virtual host BCH control panel, find the site start/stop, and then click the button behind the reload site service.

 Baidu Cloud Virtual Host BCH 3. Enter WordPress site settings to set pseudo static, and view the effect in the foreground.

Come here, Pseudo static of Baidu Cloud virtual host BCH The configuration is complete.

Video reference: BCH pseudo static rule configuration

5/5 - (2 votes)
Scroll to top