nginx rewrite of discuz

作者: zms! 日期: 2017.05.25 本文发布于1039天前 分类: Rewrite方法 相关:

server
        {
                listen       80;
                server_name www.veryad.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/www.veryad.com;

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;
}


                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                #fastcgi_pass  127.0.0.1:9000;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }
                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }
                access_log   off;
        }

返回上一页


讨论区

您尚未 登录,或请 注册

登 录 注 册


你可能也喜欢

nginx域名重写 不加www 转到加www. 2017.06.24,1 pv
nginx rewrite of discuz 2017.05.25,3 pv
手机访问电脑页面时跳转 2014.11.18,19 pv

在 JavaScript 文件中运行 PHP 代码 2014.10.08,10 pv
使用 .htaccess 缓存加速网站 2014.10.08,12 pv
强制 URL 以斜杠结尾 2014.10.08,9 pv