公告

Collapse
No announcement yet.

Discuz!X IIS 7 rewrite 規則

Collapse
X
Collapse
Who has read this thread:
 
  • Filter
  • Time
  • Show
全部清除
新帖子

  • Discuz!X IIS 7 rewrite 規則

    [hide]from: http://www.discuz.net/thread-1675687-1-1.html
    轉載: http://linux0911.no-ip.info/Discuz/t...13920-1-2.html

    需要伺服器安裝 rewrite 模組
    以下程式碼到 web.config 裡面
    Code:
            <rewrite>
                <rules>
                    <rule name="topic">
                        <match url="^(.*)/topic-(.+).html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
                    </rule>
                    <rule name="article">
                        <match url="^(.*)/article-([0-9]+).html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/portal.php\?mod=article&articleid={R:2}&{R:3}" />
                    </rule>
                    <rule name="forum">
                        <match url="^(.*)/forum-(\w+)-([0-9]+).html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
                    </rule>
                    <rule name="thread">
                        <match url="^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page\%3D{R:4}&page={R:3}&{R:5}" />
                    </rule>
                    <rule name="group">
                        <match url="^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
                    </rule>
                    <rule name="space">
                        <match url="^(.*)/space-(username|uid)-(.+).html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
                    </rule>
                    <rule name="Xrewrite">
                        <match url="^(.*)/([a-z]+)-(.+).html\?*(.*)$" />
                        <action type="Rewrite" url="{R:1}/{R:2}.php\?rewrite={R:3}&{R:4}" />
                    </rule>
                </rules>
            </rewrite>

    [/hide]
Working...
X