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>

wordpress FOR IIS7 URL Rewrite

2009/07/13 6:54 上午  |  分类:IIS7-rewrite, wordpress

wordpress 官方已经内置了 IIS7 URL Rewrite 的支持,但对于中文用户来说,官方内置的伪静态规则不能完好的支持中文tag的问题。虽然可以更改系统文件来解决,但比较麻烦,而且不方便,所以一直没介绍过。现在帖出一个自用的的规则,可以解决wordpress的中文tag的问题。
全文阅读 »

shopex 4.8 for iis 7 伪静态

2009/06/22 7:39 上午  |  分类:IIS7-rewrite, shopex

shopex 4.84 用在iis 7 url rewrite module 下的规则文件

将下列代码加入到web目录下的web.config文件的<system.webServer>之后即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
        <rewrite>
            <rules>
                <rule name="disableDownloadThemeHtml">
                    <match url="^themes/.*\.(html|xml)$" ignoreCase="false" />
                    <action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
                </rule>
                <rule name="urlRewrite">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" pattern="\.(html|xml|json|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|cgi|shtml|shtm|phtm)$" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="index.php?{R:1}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>

discuz7 for iis 7 URL Rewrite Module

2009/05/26 1:31 下午  |  分类:IIS7-rewrite

discuz 用在iis 7 url rewrite module 下的规则文件

将下列代码加入到web目录下的web.config文件的<system.webServer>之后即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
        <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>

最近几天正在测试IIS7  URL Rewrite Module 的一些伪静态规则,从RuslanY的blog上得知,wordpress2.8将内建对IIS7 URL Rewrite Module的支持,检测到环境包含IIS7 URL Rewrite Module1.1以后,在wp 2.8的后台设置=》固定链接中,选择好要使用的固定链接形式以后点击保存,将自动将相应的伪静态规则添加到web.config文件中,即可实现wordprss的固定链接。

如图所示 
全文阅读 »

IIS7-URL重写(URL Rewrite Module)

2009/05/18 1:03 下午  |  分类:IIS7-rewrite

微软在IIS7中添加了URL的重写模块,并且免费使用,可以导入.htaccess规则,确实是个不错的选择

URL Rewrite Module 

URL Rewrite Module是一个基于规则的URL重写引擎,用于在URL被Web服务器处理之前改变请求的URL。对于动态Web应用程序,它可以为用户和搜索引擎提供友好的URL,URL重写和重定向是基于HTTP头和服务器变量的,并可以对站点内容进行访问控制。

使用 IIS7 自带的 FastCgi 模式

官方地址:使用URL Rewrite Module                                                                          全文阅读 »