百度云主机WordPress设置伪静态出现404解决方法
1、打开flashfxp软件,连接上后点击webroot文件夹打开,找到app.conf文件下载到桌面,再用记事眺螗熨膣本打开它,把里面的内容删掉,复制下面的代码粘贴,并保存,然后用flashfxp上传覆盖原来的的文件。【代码如下】handlers: # 设置默认首页 - url : / script : home.php # URL Rewrite,所有的图片都访问其他地址 - regex_url: /picture/(.*\.gif) static_files: static/$1 # URL Rewrite,所有的html访问都转换为php访问 -regex_url:^/([a-z0-9]*)\.html$ script: /process.php?$1 # 重定向访问处理 -regex_url:^/permission_page$ status_code: 302 location: http://example.com/error.html # 处理404错误 - errordoc : 404 /error/404.html - errordoc : 403 /error/permission.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 # mime 设置默认首页 - mime: .txt text/plain - mime: .json application/json- rewrite_not_exist: (.*) script: /index.php/$1
2、在电脑桌面上用记事本新建一个文件,打开后输入以下代码,并另存为bcloud_nginx_user.conf这个文件名(注意:保存类型选所有文件,编码选UTF-8),然后用FTP软件上传到刚才那个目录下。代码如下:rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;if (!-e $request_filename) {rewrite ^.+?(/wp-.*) $1 last;rewrite ^.+?(/.*\.php)$ $1 last;rewrite ^ /index.php last;}
3、登录自己的Wordpress网站后台,依次点击【设置】-【固定链接】-【自定义结构】,在右边空格输入/%category%/%post_id%.html,并点击保存更改。(提示:如果不想在文章页看到category字样链接,请在分类目录前缀右边写上英文句号.)
4、登录百度主机控制面板,依次点击左边【常用操作】-【站点启停】,再点击右下边的重载站点服务,然后打开自己的网站前台,OK,恭喜你,大功告成!