日志分类:discuz

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的在这里

discuz uchome IIS7 rewrite规则

2010/03/17 12:51 下午  |  分类:IIS7-rewrite, discuz

将以下内容添加到web.config文件中即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
            <rules>
                <rule name="Imported Rule 17">
                    <match url="^archiver/((fid|tid)-[\w\-]+\.html)$" ignoreCase="false" />
                    <action type="Rewrite" url="archiver/index.php?{R:1}" appendQueryString="false" />
                </rule>
                <rule name="Imported Rule 18">
                    <match url="^forum-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
                    <action type="Rewrite" url="forumdisplay.php?fid={R:1}&amp;page={R:2}" appendQueryString="false" />
                </rule>
                <rule name="Imported Rule 19">
                    <match url="^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
                    <action type="Rewrite" url="viewthread.php?tid={R:1}&amp;extra=page\%3D{R:3}&amp;page={R:2}" appendQueryString="false" />
                </rule>
                <rule name="Imported Rule 20">
                    <match url="^space-(username|uid)-(.+)\.html$" ignoreCase="false" />
                    <action type="Rewrite" url="space.php?{R:1}={R:2}" appendQueryString="false" />
                </rule>
                <rule name="Imported Rule 21">
                    <match url="^tag-(.+)\.html$" ignoreCase="false" />
                    <action type="Rewrite" url="tag.php?name={R:1}" appendQueryString="false" />
                </rule>
            </rules>
</rewrite>
</system.webServer>
</configuration>

uchome独立使用的伪静态规则

2009/05/29 7:04 上午  |  分类:discuz

最近有朋友在空间主目录下只装了uchome,问到要如何设置伪静态,其它在之前发过的uchome和dz共用的规则文件,稍改动一下就可以使用,不会改的直接下载下面这个规则文件使用吧,如果你的uchome不是安装在子目录的话。

Download uchome Version 1.5

UChome和discuz共用的伪静态规则

2009/04/16 9:38 上午  |  分类:discuz

UChome 和Discuz共用的伪静态规则文件。

压缩包包含httpd.ini和.htaccess文件,请根据 自己使用的主机系统选择使用。

全文阅读 »

discuz 7.0 伪静态 设置及规则下载

2009/04/09 2:45 下午  |  分类:discuz

discuz 7.0 的伪静态规则 ,包括win主机常用httpd.ini和linux下常用的.htaccess规则文件

首先下载提供的伪静态规则放入网站根目录,然后进入discuz系统设置后台,按下图将url静态化的选项勾选,即可启用discuz伪静态

全文阅读 »