discuz,ecshop的伪静态规则(apache+nginx)
2024-09-03 14:44:39
discuz(nginx): (备注:该规则也适用于二级目录)
rewrite ^([^\.]*)/topic-(.+)\.html$ $/portal.php?mod=topic&topic=$ last;
rewrite ^([^\.]*)/article-([-]+)-([-]+)\.html$ $/portal.php?mod=view&aid=$&page=$ last;
rewrite ^([^\.]*)/forum-(\w+)-([-]+)\.html$ $/forum.php?mod=forumdisplay&fid=$&page=$ last;
rewrite ^([^\.]*)/thread-([-]+)-([-]+)-([-]+)\.html$ $/forum.php?mod=viewthread&tid=$&extra=page%3D$&page=$ last;
rewrite ^([^\.]*)/group-([-]+)-([-]+)\.html$ $/forum.php?mod=group&fid=$&page=$ last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $/home.php?mod=space&$=$ last;
rewrite ^([^\.]*)/blog-([-]+)-([-]+)\.html$ $/home.php?mod=space&uid=$&do=blog&id=$ last;
rewrite ^([^\.]*)/(fid|tid)-([-]+)\.html$ $/index.php?action=$&value=$ last;
rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $/plugin.php?id=$:$ last;
ecshop(nginx): (备注:其中if那里可以不要;如果在二级目录,则每条规则需要加上子目录名称)
#if (!-e $request_filename)
#{
rewrite "^/index\.html" /index.php last;
rewrite "^/category$" /index.php last; rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$ last;
rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$ 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=$&brand=$&price_min=$&price_max=$&filter_attr=$&page=$&sort=$&order=$ last;
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$&brand=$&price_min=$&price_max=$&filter_attr=$ last;
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$&brand=$&page=$&sort=$&order=$ last;
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$&brand=$&page=$ last;
rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$&brand=$ last;
rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$ last; rewrite "^/shop/goods-([0-9]+)(.*)\.html" /shop/goods.php?id=$ last; rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$&page=$&sort=$&order=$ last;
rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$&page=$ last;
rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$ last; rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$ last; rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$&cat=$&page=$&sort=$&order=$ last;
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$&cat=$&page=$ last;
rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$&cat=$ last;
rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$ last; rewrite "^/tag-(.*)\.html" /search.php?keywords=$ last;
rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$ last;
rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$ last;
rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$ last; rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$&act=view last;
rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$&integral_min=$&integral_max=$&page=$&sort=$&order=$ last;
rewrite ^/exchange-([-]+)-([-]+)-(.+)-([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=$&page=$ last;
rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$ last;
#}
最新文章
- sql编写将时间转换年月日 时分格式
- 新特性AAtitti css3 新特性attilax总结titti css
- 移动端手势库Hammer.js学习
- [ActionScript] AS3代码实现渐变遮罩效果
- mysql之触发器
- Interface和Abstract class区别
- ZOJ 1301 The New Villa (BFS + 状态压缩)
- 排列与组合的C语言实现
- compass安装教程
- 你真的了解volatile吗,关于volatile的那些事
- 玩转spring boot——websocket
- JAVA NIO之文件通道
- ros卸载
- centos搭建OPENldap
- 启动android monitor报错解决办法
- Spring 学习(五)--- 事务(未完成)
- CountDownLatch详解
- 最近总想着写一个模拟alert和confirm插件,代替原生的
- Gray Code——陈瑶师姐面试时候要用回溯算法
- 关于react-redux中Provider、connect的解析