AMH 社区首页
AMH社区 - 开放自由有价值的社区
[求助帖] 再发个自用的dz静态化+301重定位的Rewrite规则!!! |
|
---|---|
lihai3310 |
lihai3310 发表于 2013-03-18 19:56:58
代码见下,纯网络组合,无任何技术含量(xxx处需要修改哟)
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 ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last; rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last; if (!-e $request_filename) { return 404; } if ($host != 'www.xxx.com') { rewrite ^/(.*)$ http://www.xxx.com/$1 permanent; }
点赞,加油! (0分)
2013-03-18 19:56:58 1
|
admin |
dz后台好像有提供rewrite生成吧~~:P
回复
2013-03-18 20:32:00 2
AMH官方号 2011~2021 (10周年) |