解决百度云主机(BCH)wordpress程序伪静态和后台打开404问题
步骤如下:
1、可以自行创建配置文件,并保存为“bcloud_nginx_user.conf”,文件内容如下:
if (-f $request_filename/index.html){rewrite (.*) $1/index.html break;}if (-f $request_filename/index.php){rewrite (.*) $1/index.php;}if (!-f $request_filename){rewrite (.*) /index.php;}
2、将配置文件上传到主机中
先将bcloud_nginx_user.conf上传至网站根目录下(即webroot目录)
3.登录自己的Wordpress网站后台
依次点击【设置】-【固定链接】-【自定义结构】,在右边空格输入/%category%/%post_id%.html[或者/%postname%.html],并点击保存更改。
4.上传完成后需要在BCH控制面板中重载一下站点生效
重载一下站点,等待10分钟左右生效