php 伪静态规则,常用伪静态规则(for 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;
tags
rewrite ^/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;
}
php 伪静态规则,常用伪静态规则(for Nginx)相关推荐
- 织梦html伪静态页面,dedecms织梦全站伪静态设置+全套伪静态规则
请确保你网站所在的主机或者服务器支持伪静态并且已经开启了伪静态功能! 本教程主要设置织梦伪静态页面包括有: 1.列表页 /plus/list-2.html 2.列表页分页 /plus/list-2-2 ...
- 帝国cms linux伪静态规则,置帝国cms如何设置tag标签伪静态化 linux伪静态设置方法_博客...
<置帝国cms如何设置tag标签伪静态化 linux伪静态设置方法_博客>由会员分享,可在线阅读,更多相关<置帝国cms如何设置tag标签伪静态化 linux伪静态设置方法_博客(6 ...
- 建立索引常用的规则如下
建立索引常用的规则如下: 1.表的主键.外键必须有索引: 2.数据量超过300的表应该有索引: 3.经常与其他表进行连接的表,在连接字段上应该建立索引: 4.经常出现在Where子句中的字段,特别是 ...
- MySQL索引介绍,普通索引,全文索引,空间索引,多列索引使用原则,建立索引常用的规则
转自:https://blog.csdn.net/tomorrow_fine/article/details/78337735 1.MySQL在创建数据表的时候创建索引 在MySQL中创建表的时候,可 ...
- Java代码的维护与更新,Java常用的规则引擎,让你变动的代码更加容易维护
Java常用的规则引擎,让你变动的代码更加容易维护 Java常用的规则引擎,让你变动的代码更加容易维护 在本文中,我们将介绍Java中一些最受欢迎的规则引擎. 规则引擎由推理引擎发展而来,是一种嵌入在 ...
- 史上最全的HTML和CSS标签常用命名规则
文件夹主要建立以下文件夹: 1.Images 存放一些网站常用的图片: 2.Css 存放一些CSS文件: 3.Flash 存放一些Flash文件: 4.PSD 存放一些PSD源文件: 5.Temp 存 ...
- CSS的class、id、css文件名的常用命名规则
CSS的class.id.css文件名的常用命名规则 (一)常用的CSS命名规则 头:header 内容:content/container 尾:footer 导航:nav 侧栏:sid ...
- mysql 分区 mycat 分片_Mysql系列六:(Mycat分片路由原理、Mycat常用分片规则及对应源码介绍)...
一.Mycat分片路由原理 我们先来看下面的一个SQL在Mycat里面是如何执行的: select * from travelrecord where id in(5000001, 10000001) ...
- CSS的class常用命名规则
CSS的class.id.css文件名的常用命名规则 (1)常用的CSS命名规则 头:header 内容:content/container 尾:footer 导航:nav 侧栏:sidebar 栏目 ...
- mycat 常用分片规则使用详解
前言 在上一篇,详细了解了使用mycat进行数据库的垂直拆分和表的水平拆分,本篇在此基础上继续探讨mycat的常用分片规则. 什么是分片规则? 分片规则就是按照一定的规则(算法),将数据分散存储到多个 ...
最新文章
- 聊一聊Spring中的线程安全性
- RequisitePro SQL SERVER数据库的配置
- matlab 去除pdf文档水印
- 易语言通过服务器发送文件,易语言服务器与客户端发送文件
- WPF之Manipulation
- linux中代码挂上n,Linux系统常用命令nl详解(示例代码)
- 图形的认识(curve,surface,hypersurface)
- C#读写SQLSERVER中Image类型图片
- html 科赫雪花,CSS3 科赫雪花分形动画
- 解决360抢票王刷票0.1秒停顿问题,思考抢票软件和IT行业
- MATHLAB GUI编程简易入门
- Python的Couter使用,计算字符串中每个单词出现的次数
- 六,iOS中的金额格式化和金额大小写转换
- 华三h3c系列交换机ACL实践
- 降低芯片设计创新门槛——从互联网成功经验看开源芯片生态发展
- 浮点运算单元FPU能给电机控制带来什么?
- 【Codeforces 1038D】Slime
- 【云原生之Docker实战】使用Docker部署Flarum开源论坛
- c语言奇数阶幻方构造法,奇数阶面幻方的行列式构造法.pdf
- “还完花呗,再也不用吃土!”是真的吗?