IIS 7.5通過web.config設(shè)置偽靜態(tài)規(guī)則方法
來源:易賢網(wǎng) 閱讀:4217 次 日期:2015-02-05 14:04:45
溫馨提示:易賢網(wǎng)小編為您整理了“IIS 7.5通過web.config設(shè)置偽靜態(tài)規(guī)則方法”,方便廣大網(wǎng)友查閱!

is7.5下常見程序通過web.config實現(xiàn)偽靜態(tài)新建一個以web.config命名的文件內(nèi)容為

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<system.webServer>

<!--將下面的規(guī)則添加到這里-->

</system.webServer>

</configuration>

記得后臺的偽靜態(tài)要開啟喔

以shopex規(guī)則示例如下,選擇需要的規(guī)則添加:

<!--shopex-->

<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>

<!--dz2.0-->

<rewrite>

<rules>

<rule name="portal_topic">

<match url="^(.*/)*topic-(.+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/portal.php?mod=topic&amp;topic={R:2}&amp;{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&amp;aid={R:2}&amp;page={R:3}&amp;{R:4}" />

</rule>

<rule name="forum_forumdisplay">

<match url="^(.*/)*forum-(w+)-([0-9]+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/forum.php?mod=forumdisplay&amp;fid={R:2}&amp;page={R:3}&amp;{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&amp;tid={R:2}&amp;extra=page={R:4}&amp;page={R:3}&amp;{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&amp;fid={R:2}&amp;page={R:3}&amp;{R:4}" />

</rule>

<rule name="home_space">

<match url="^(.*/)*space-(username|uid)-(.+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/home.php?mod=space&amp;{R:2}={R:3}&amp;{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&amp;uid={R:2}&amp;do=blog&amp;id={R:3}&amp;{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}&amp;value={R:3}&amp;{R:4}" />

</rule>

</rules>

</rewrite>

<!--dz2.5-->

<rewrite>

<rules>

<rule name="portal_topic">

<match url="^(.*/)*topic-(.+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/portal.php?mod=topic&amp;topic={R:2}&amp;{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&amp;aid={R:2}&amp;page={R:3}&amp;{R:4}" />

</rule>

<rule name="forum_forumdisplay">

<match url="^(.*/)*forum-(w+)-([0-9]+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/forum.php?mod=forumdisplay&amp;fid={R:2}&amp;page={R:3}&amp;{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&amp;tid={R:2}&amp;extra=page={R:4}&amp;page={R:3}&amp;{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&amp;fid={R:2}&amp;page={R:3}&amp;{R:4}" />

</rule>

<rule name="home_space">

<match url="^(.*/)*space-(username|uid)-(.+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/home.php?mod=space&amp;{R:2}={R:3}&amp;{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&amp;uid={R:2}&amp;do=blog&amp;id={R:3}&amp;{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}&amp;value={R:3}&amp;{R:4}" />

</rule>

<rule name="plugin">

<match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_-]+).html?*(.*)$" />

<action type="Rewrite" url="{R:1}/plugin.php?id={R:2}:{R:3}&amp;{R:4}" />

</rule>

</rules>

</rewrite>

更多信息請查看IT技術(shù)專欄

更多信息請查看數(shù)據(jù)庫
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇剩?/div>

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)