nginx环境下Discuz+SS的rewrite写法,要适当作一些修改,代码如下:
把相应代码写入cd /usr/local/nginx/conf/vhosts的对应虚拟主机配置文件中。
------------------------------------------
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;
-----------------------------------------
SS:
-----------------------------------------
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;
rewrite ^/bbs/(.*) http://bbs.yaoyedan.com/$1;
如果TAG页面无法显示,则是Rewrite 兼容性问题。
进入Discuz后台,基本设置,搜索引擎优化,Rewrite 兼容性,选项处选“否”。
重启ningx后,再试试。
06月 13th, 2008 at 11:56 #car insurance company
car insurance company...
copyrighted inheritance firmware ...
07月 3rd, 2008 at 12:46 #motorcycle insurance company
motorcycle insurance company...
begrudge bereaved butterfat 21 century ins [url=http://www.qualityinsureplan.com/21-century-ins.html]21 century ins[/url] http://www.qualityinsureplan.com/21-century-ins.html ...
07月 19th, 2008 at 1:34 #suite 332 online
suite 332 online...
redneck mist butterflies!...