xmao’s blog

Tag: discuz

Discuz 在IIS7下的Rewrite规则

by xmao on Mar.06, 2009, under Development, Internet, System, Windows Server

Discuz使用IIS7的Rewrite模块,与官方使用第三方的规则还是略有区别,给个简单例子,你可以举一反三..
加入到web.config中的..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
        <rewrite>
            <rules>
                <rule name="Forumdisplay Rewrite Rule" stopProcessing="true">
                    <match url="^forum-([^/]+)-([^/]+).html?$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="forumdisplay.php?fid={R:1}&amp;page={R:2}" />
                </rule>
                <rule name="Viewthread Rewrite Rule" stopProcessing="true">
                    <match url="^thread-([^/]+)-([^/]+)-([^/]+).html?$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="viewthread.php?tid={R:1}&amp;extra=page%3D{R:2}&amp;page={R:3}" />
                </rule>
            </rules>
        </rewrite>
Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...