如何在百度云虚拟主机BCH上配置WordPress伪静态

如何在百度云虚拟主机BCH上配置WordPress伪静态,第1张

百度云虚拟主机BCH

通过url/regex_url和rewrite_not_exist配合使用,能够实现绝大多数伪静态功能。本节将以Wordpress和discuz为例,给出典型的app.conf配置示例。

如没有app.conf文件可在桌面建立文件通过FTP上传网站根目录。

wordpress

如果wordpress设置为“朴素”方式,则app.conf不需要进行其他处理。如果为其他方式,则需要在app.conf中加入以下规则:

- rewrite_not_exist: (.*)

script: /index.php/$1

完整的app.conf文件内容如下:

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

discuz

如果用户部署的是discuz,建议在app.conf中加入以下规则:

- regex_url: ^/topic-(.+).html$

script: /portal.php?mod=topic&topic=$1&%1

- regex_url: ^/article-([0-9]+)-([0-9]+).html$

script: /portal.php?mod=view&aid=$1&page=$2&%1

- regex_url: ^/forum-(w+)-([0-9]+).html$

script: /forum.php?mod=forumdisplay&fid=$1&page=$2&%1

- regex_url: ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$

script: /forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&%1

- regex_url: ^/group-([0-9]+)-([0-9]+).html$

script: /forum.php?mod=group&fid=$1&page=$2&%1

- regex_url: ^/space-(username|uid)-(.+).html$

script: /home.php?mod=space&$1=$2&%1

- regex_url: ^/blog-([0-9]+)-([0-9]+).html$

script: /home.php?mod=space&uid=$1&do=blog&id=$2&%1

- regex_url: ^/archiver/(fid|tid)-([0-9]+).html$

script: /archiver/index.php?action=$1&value=$2&%1

- regex_url: ^/([a-z]+[a-z0-9_]*)-([a-z0-9_-]+).html$

script: /plugin.php?id=$1:$2&%1

完整的app.conf内容如下:

handlers:

- url : /

script : /index.php

script : /index.html

- regex_url: ^/topic-(.+).html$

script: /portal.php?mod=topic&topic=$1&%1

- regex_url: ^/article-([0-9]+)-([0-9]+).html$

script: /portal.php?mod=view&aid=$1&page=$2&%1

- regex_url: ^/forum-(w+)-([0-9]+).html$

script: /forum.php?mod=forumdisplay&fid=$1&page=$2&%1

- regex_url: ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$

script: /forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&%1

- regex_url: ^/group-([0-9]+)-([0-9]+).html$

script: /forum.php?mod=group&fid=$1&page=$2&%1

- regex_url: ^/space-(username|uid)-(.+).html$

script: /home.php?mod=space&$1=$2&%1

- regex_url: ^/blog-([0-9]+)-([0-9]+).html$

script: /home.php?mod=space&uid=$1&do=blog&id=$2&%1

- regex_url: ^/archiver/(fid|tid)-([0-9]+).html$

script: /archiver/index.php?action=$1&value=$2&%1

- regex_url: ^/([a-z]+[a-z0-9_]*)-([a-z0-9_-]+).html$

script: /plugin.php?id=$1:$2&%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

答案文章来源:http://abcfund.cc/1698.html

也可以参考百度官方来源:https://bce.baidu.com/doc/BCH/GettingStarted/37.5C.E4.BC.AA.E9.9D.99.E6.80.81URLRewrite.E7.A4.BA.E4.BE.8B.html

链接: https://pan.baidu.com/s/1hF4mfEAVCdGBJZtHynFZ9w

提取码: 3bce 复制这段内容后打开百度网盘手机App,操作更方便哦

《狱前教育》是由美国华纳兄弟影片公司出品的喜剧电影,由伊坦·柯亨执导,威尔·法瑞尔、凯文·哈特联袂主演。该片于2015年3月27日在美国上映。

如果资源不正确,或者版本不正确,欢迎追问


欢迎分享,转载请注明来源:夏雨云

原文地址:https://www.xiayuyun.com/zonghe/213721.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-05
下一篇2023-04-05

发表评论

登录后才能评论

评论列表(0条)

    保存