容器技术交流

 找回密码
 立即注册
查看: 14899|回复: 14

各种程序的Nginx的静态化规则

[复制链接]
发表于 2009-5-27 17:57:50 | 显示全部楼层 |阅读模式
# Supsite 6X
rewrite ^([0-9]+)/spacelist(.*)$ index.php?$1/action_spacelist$2;
rewrite ^([0-9]+)/viewspace_(.+)$ index.php?$1/action_viewspace_itemid_$2;
rewrite ^([0-9]+)/viewbbs_(.+)$ index.php?$1/action_viewbbs_tid_$2;
rewrite ^([0-9]+)/(.*)$ index.php?$1/$2;
rewrite ^([0-9]+)$ index.php?$1;
rewrite ^action_(.+)$ index.php?action_$1;
rewrite ^category_(.+)$ index.php?action_category_catid_$1;
rewrite ^itemlist_(.+)$ index.php?action_itemlist_catid_$1;
rewrite ^viewnews_(.+)$ index.php?action_viewnews_itemid_$1;
rewrite ^viewthread_(.+)$ index.php?action_viewthread_tid_$1;
rewrite ^index([\.a-zA-Z0-9]*)$ index.php;
rewrite ^html/([0-9]+)/viewnews_itemid_([0-9]+)\.html$ index.php?action_viewnews_itemid_$2;
rewrite ^/([0-9]+)/spacelist(.+)$ /index.php?uid/$1/action/spacelist/type$2;
rewrite ^/([0-9]+)/viewspace(.+)$ /index.php?uid/$1/action/viewspace/itemid$2;
rewrite ^/([0-9]+)/viewbbs(.+)$ /index.php?uid/$1/action/viewbbs/tid$2;
rewrite ^/([0-9]+)/(.*)$ /index.php?uid/$1/$2;
rewrite ^/([0-9]+)$ /index.php?uid/$1;
rewrite ^/action(.+)$ /index.php?action$1;
rewrite ^/category(.+)$ /index.php?action/category/catid$1;
rewrite ^/viewnews(.+)$ /index.php?action/viewnews/itemid$1;
rewrite ^/viewthread(.+)$ /index.php?action/viewthread/tid$1;
rewrite ^/mygroup(.+)$ /index.php?action/mygroup/gid$1;

# Discuz
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;
break;


http://www.anilcetin.com/convert-apache-htaccess-to-nginx/   这个可以自动转换成nginx的规则
 楼主| 发表于 2009-5-27 20:43:16 | 显示全部楼层
大家找找规律,其实非常简单的
发表于 2009-5-27 21:10:26 | 显示全部楼层
我在用的Bo-Blog 2.1.1 Release 的!

演示 http://zuu.cn/
如下

rewrite ^/post/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ /read.php?entryid=$1&page=$2&part=$3 last;
rewrite ^/page/([0-9]+)/([0-9]+)/?$ /index.php?mode=$1&page=$2 last;
rewrite ^/starred/([0-9]+)/?([0-9]+)?/?$ /star.php?mode=$1&page=$2 last;
rewrite ^/category/([^/]+)/?([0-9]+)?/?([0-9]+)?/?$ /index.php?go=category_$1&mode=$2&page=$3 last;
rewrite ^/archiver/([0-9]+)/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ /index.php?go=archive&cm=$1&cy=$2&mode=$3&page=$4 last;
rewrite ^/date/([0-9]+)/([0-9]+)/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ /index.php?go=showday_$1-$2-$3&mode=$4&page=$5 last;
rewrite ^/user/([0-9]+)/?$ /view.php?go=user_$1 last;
rewrite ^/tags/([^/]+)/?([0-9]+)?/?([0-9]+)?/?$ /tag.php?tag=$1&mode=$2&page=$3 last;
rewrite ^/component/id/([0-9]+)/?$ /page.php?pageid=$1 last;
rewrite ^/component/([^/]+)/?$ /page.php?pagealias=$1 last;

如果我的信息帮助了你,请送我IP吧! http://zuu.cn/
发表于 2009-5-27 21:14:37 | 显示全部楼层
phpwind的

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



RewriteRule ^(.*)/forumdisplay.php   $1/thread.php   [NC]
RewriteRule ^(.*)/viewthread.php    $1/read.php     [NC]
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/thread.php?fid=$2
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/read.phptid=$2
RewriteRule (.*)/archiver/?tid-([0-9]+)\.html$   $1/simple/index.php?t$1\.html
RewriteRule (.*)/archiver/?fid-([0-9]+)\.html$   $1/simple/index.php?f$1\.html

给你看我找到的 仅供参考

如果我的信息帮助了你,请送我IP吧! http://zuu.cn/

[ 本帖最后由 个人神话 于 2009-5-27 21:16 编辑 ]
发表于 2009-5-28 00:04:39 | 显示全部楼层
好帖
.
.
.
发表于 2009-6-6 17:19:24 | 显示全部楼层
谁给个joomla的规则?
发表于 2009-6-10 10:41:54 | 显示全部楼层
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;
}
发表于 2009-6-16 04:33:03 | 显示全部楼层
b好好
发表于 2009-7-4 15:34:47 | 显示全部楼层
弱弱问一下洞版,这个规则有啥作用呢?
发表于 2009-7-11 07:59:57 | 显示全部楼层
UCHOME的规则有吗。
发表于 2009-11-16 09:36:48 | 显示全部楼层
楼主真好。。
发表于 2010-2-9 11:52:33 | 显示全部楼层
这个规则应该放到哪里???
发表于 2010-8-23 15:28:51 | 显示全部楼层
谁做个帝国6.5的啊
发表于 2012-1-26 12:18:51 | 显示全部楼层
跪求magento的
发表于 2012-2-10 00:38:40 | 显示全部楼层
非常感谢您!












全额自动返现工具,淘比(TaobiEngine.com)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-5-16 04:36 , Processed in 0.039136 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表