discuz X 伪静态规则-IIS -Nginx-Apache

2010/05/07 7:16 上午  |  分类:discuz, nginx

康胜刚刚发布了discuz x beta 版本,在管理后台,全局 » 优化设置 » 搜索引擎优化 选中url静态化的选项即可,相关规则文件官方已经出示例,摘录如下:

IIS-Isapi

[ISAPI_Rewrite]
 
[ISAPI_Rewrite]
 
# 3600 = 1 hour
CacheClockRate 3600
 
RepeatLimit 32
 
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4

全文阅读 »

uchome rewrite for nginx

2010/03/27 6:36 下午  |  分类:discuz, nginx

ngnix下uchome的伪静态规则,可以和discuz的规则合用

1
2
3
4
5
location / {
     rewrite ^(.*)/(space|network)\-(.+)\.html$ $1/$2.php?rewrite=$3 last;
     rewrite ^(.*)/(space|network)\.html$ $1/$2.php last;
     rewrite ^(.*)/([0-9]+)$ $1/space.php?uid=$2 last;
        }

discuz rewrite for nginx

2010/03/27 6:28 下午  |  分类:discuz, nginx

discuz 在nginx下的伪静态规则! (ps:discuz的伪静态规则 ,一般情况下是通用的,不必区分是discuz6还是7)

location / {
      rewrite ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2 last;
      rewrite ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3 last;
      rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 last;
      rewrite ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro.php?$2=$3 last;
      rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3 last;
      rewrite ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2 last;
        }

Uchome的在这里

typecho的rewrite规则for Nginx

2010/03/20 6:04 下午  |  分类:nginx

typecho在nginx下的rewrite有好多方法,试下来还是这个方便一些!

1
2
3
4
5
6
7
8
9
10
11
12
location / {
        index index.html index.php;
        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;
        }
    }

全文阅读 »

NGNIX–高性能的 HTTP 和 反向代理 服务器

2010/03/17 12:59 下午  |  分类:nginx

           Nginx (“engine x”) 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了。Igor 将源代码以类BSD许可证的形式发布。

  Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,其中包括新浪博客新浪播客网易新闻腾讯网搜狐博客等门户网站频道,六间房56.com等视频分享网站,Discuz!官方论坛水木社区等知名论坛,盛大在线金山逍遥网等网络游戏网站,豆瓣人人网YUPOO相册金山爱词霸迅雷在线等新兴Web 2.0网站。

        Nginx不光是一些大型站点应该效率高,而且由于本身的小巧和高效率,深受广大个人站长的喜爱,许多站长应用在vps上以减少系统资源的应用 。以后将添加一些Ngnix的伪静态规则