比思論壇
標題:
DiscuzX1.5/2 IIS7的rewirte/偽靜態教學
[打印本頁]
作者:
LINUS
時間:
2011-3-21 11:23
標題:
DiscuzX1.5/2 IIS7的rewirte/偽靜態教學
II7要把DISCUZ由動態換成偽成態有二個方法,一個是用ISPAI偽靜態插件,另一方法是IIS本身提供的URL Rewirte的插件,可以經由微軟的Platform install安裝,過程十分簡單。
今次我們用URL Rewirte作為偽靜態的方法
在根目錄創造一個名為web.config的文件,內容如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="portal_topic">
<match url="^(.*/)*topic-(.+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
</rule>
<rule name="portal_article">
<match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_forumdisplay">
<match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_viewthread">
<match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<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_group">
<match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="home_space">
<match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
</rule>
<rule name="all_script">
<match url="^(.*/)*([a-z]+)-(.+).html\?*(.*)[ DISCUZ_CODE_0 ]quot; />
<action type="Rewrite" url="{R:1}/{R:2}.php\?rewrite={R:3}&{R:4}" />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.web>
<customErrors mode="Off" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
</system.web>
</configuration>
複製代碼
之後可以到後台把搜尋器的各樣優化偽靜態的功能打開了,是不是很簡單?
作者:
admin
時間:
2011-6-5 08:50
補上X2 的 REWIRTE
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="portal_topic">
<match url="^(.*/)*topic-(.+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
</rule>
<rule name="portal_article">
<match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_forumdisplay">
<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="forum_viewthread">
<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_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="home_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="home_blog">
<match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/home.php\?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
</rule>
<rule name="forum_archiver">
<match url="^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.web>
<customErrors mode="Off" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
</system.web>
</configuration>
複製代碼
作者:
中路的神话
時間:
2013-8-7 07:44
我想问下版主们论坛架设的主机平常家用主机能用吗?
歡迎光臨 比思論壇 (http://108.170.5.98/)
Powered by Discuz! X2.5