[不花钱站长]:从免费域名开始[0元] Oracle永久免费VPS[0元] VPS环境搭建免费脚本[0元] 秒变大盘挂载免费网盘[0元] 小白免费采集器1天500W[0元] CF免费DNS+CDN服务[0元]
[零基础网赚]:撸本站免费源码[0元] 网站强引免费蜘蛛法[0元] 图片视频文件免费存储[0元] 外链轻松发布免费友链[0元] 入坑免费教程学习源代码[0元] 网上百种+赚钱联盟推荐[?元]

↑↑VPS推荐网 WWW.VPS.COM.IN 稳定 便宜 免备案↑↑


您现在的位置是:首页 > 全球[VPS测评] >  Discuz,EcShop,nginx,Shopex,Wordpress,伪静态,国外永久免费VPS

分享:常见PHP程序在Nginx环境下的伪静态规则汇总

全球[VPS测评]来源:VPS推荐网点击:952
【性价之王】【线路之王】【价格之王】【配置之王】
【免费之王】【香港首推】【梯子之王】【独服之王】
分享:常见PHP程序在Nginx环境下的伪静态规则汇总

很多时候我们找一些规则可以说“要的时候,怎么找也找不到,不用的时候,天天都随处可见”!这样的情况,想必多数伙伴们遇到过吧!的确这样的情况太多了!对于不同程序的伪静态规则在不同的环境中是有点差别的,今天小七通过收集整理了一下“常见PHP程序在Nginx环境下的伪静态规则”,也方便以后自己使用,毕竟度娘的东西说真的真心的不好用,出来的多数都是一些老掉牙的东西,对于老掉牙的排名还不错,对于一些新的说实在的就是把你脑袋抓破了都没得!

1、WordPress伪静态

复制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、PHPCMS伪静态

复制rewrite ^/caipu-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;rewrite ^/list-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last;rewrite ^/tag-([^\.]*)-([0-9]+)-([0-9]+).html /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3 last;rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3 last;rewrite ^/([^\.]*).html /index.php?m=member&c=index&a=$1 last;

3、DEDECMS伪静态

复制rewrite "^/index.html$" /index.php last;rewrite "^/list-([0-9]+)\.html$" /plus/list.php?tid=$1 last;rewrite "^/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$" /plus/list.php?tid=$1&totalresult=$2&PageNo=$3 last;rewrite "^/view-([0-9]+)-1\.html$" /plus/view.php?arcID=$1 last;rewrite "^/view-([0-9]+)-([0-9]+)\.html$" /plus/view.php?aid=$1&pageno=$2 last;rewrite "^/tags.html$" /tags.php last;rewrite "^/tag-([0-9]+)-([0-9]+)\.html$" /tags.php?/$1/$2/ last;

4、Discuz7伪静态

复制rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page\%3D$3&page=$2 last;rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;

5、DiscuzX伪静态

复制rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;if (!-e $request_filename) {return 404;}

6、ECSHOP伪静态

复制if (!-e $request_filename){rewrite "^/index\.html" /index.php last;rewrite "^/category$" /index.php last;rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$1 last;rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$1 last;rewrite "^/feed\.xml$" /feed.php last;rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3 last;rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2 last;rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$1 last;rewrite "^/goods-([0-9]+)(.*)\.html" /goods.php?id=$1 last;rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$1&page=$2 last;rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$1 last;rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$1 last;rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2&page=$3 last;rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2 last;rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$1 last;rewrite "^/tag-(.*)\.html" /search.php?keywords=$1 last;rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$1 last;rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$1 last;rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$1 last;rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$1&act=view last;rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;rewrite "^/exchange-([0-9]+)-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2 last;rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1 last;}

7、PHPWind伪静态

复制rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;

8、SaBlog2.0伪静态

复制# 只带月份的归档rewrite "^/date/([0-9]{6})/?([0-9]+)?/?$" /index.php?action=article&setdate=$1&page=$2 last;# 无分类翻页rewrite ^/page/([0-9]+)?/?$ /index.php?action=article&page=$1 last;# 分类rewrite ^/category/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&cid=$1&page=$2 last;rewrite ^/category/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&curl=$1&page=$2 last;# 归档、高级搜索rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last;# 全部评论、标签列表、引用列表 带分页rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1&page=$2 last;# tagsrewrite ^/tag/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&item=$1&page=$2 last;# 文章rewrite ^/archives/([0-9]+)/?([0-9]+)?/?$ /index.php?action=show&id=$1&page=$2 last;# RSS rewrite ^/rss/([0-9]+)?/?$ /rss.php?cid=$1 last;rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last;# 用户 rewrite ^/uid/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&uid=$1&page=$2 last;rewrite ^/user/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&user=$1&page=$2 last;# 地图文件rewrite sitemap.xml sitemap.php last;# 自定义链接rewrite ^(.*)/([0-9a-zA-Z\-\_]+)/?([0-9]+)?/?$ $1/index.php?action=show&alias=$2&page=$3 last;

9、SHOPEX伪静态

复制if (!-e $request_filename) {rewrite ^/(.+\.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last;}

10、Typecho伪静态

复制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;}

以后其他的在随时补充,或者你有一些其他的也可以留言,一起集中在一起!说实在的凭借小七一个人之力实在是太渺小了,如果大家可以互相合作,那也许就是另外一片天地啦!


[Discuz]历史优惠活动内容
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • discuz X3.1 X3.2 X3.3 论坛搬家完美详细教程
  • 来自 Discuz 的经典 php 加密&解密函数 AuthCode()
  • Linux VPS主机AMH面板下安装Discuz程序教程 附设置伪静态
  • AMH管理面板实现Discuz程序伪静态设置
  • 解决Discuz程序\\”UCenter info: Can not connect to
  • Discuz官方论坛关闭发言权 Discuz应用开发者怎么办
  • 解决LNMP安装Discuz! X2.5\\”通信失败\\”方法
  • Discuz程序通用.HTACCESS伪静态文件及设置方法
  • 解决WDCP面板安装Discuz GBK编码程序乱码问题
  • 关注Discuz X1 或5月底发布
  • Discuz!X1 Beta于29日17:45康盛下载中心上线
  • Discuz!X1正式版发布啦!
  • 关注Discuz X1 或5月底发布
  • Discuz!X1 Beta于29日17:45康盛下载中心上线
  • Discuz!X1正式版发布啦!
  • Discuz官方论坛关闭发言权 Discuz应用开发者怎么办
  • 解决LNMP安装Discuz! X2.5\”通信失败\”方法
  • Discuz程序通用.HTACCESS伪静态文件及设置方法
  • 解决WDCP面板安装Discuz GBK编码程序乱码问题
  • 永久删除你在任何 Discuz! X 论坛的帐号
  • 新手站建之-Discuz论坛建站教程
  • 永久删除你在任何 Discuz! X 论坛的帐号
  • 新手站建之-Discuz论坛建站教程
  • 永久删除你在任何 Discuz! X 论坛的帐号
  • 新手站建之-Discuz论坛建站教程
  • 永久删除你在任何 Discuz! X 论坛的帐号
  • Discuz! X3.3即将发布→支持PHP7几多项更新

  • 猜你可能想看的VPS


    转载请注明原文地址:http://140.238.13.167:12355/read-77691.html

    下一篇       上一篇