2012-02-29 139 views
0

我在的地方目前在IIS上這個重寫規則:IIS URL重寫例外

<rewrite> 
      <rules> 
       <rule name="rewrite asp"> 
        <!--Removes the .asp extension for all pages.--> 
        <match url="(.*)" /> 
        <conditions logicalGrouping="MatchAll"> 
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
        <add input="{REQUEST_FILENAME}" negate="true" pattern="(.*).asp" /> 
        </conditions> 
        <action type="Rewrite" url="{R:1}.asp" /> 
       </rule>   
      </rules> 
     </rewrite> 

這使得這樣的:

site.com/allpages - > site.com/allpages.asp

現在,是否有可能創建一個異常,以便一個特定的頁面重寫爲另一個擴展?

site.com/exception - > site.com/exception.php

回答

0

創建另一個規則,這是與匹配圖案中的 'ASP' 規則以上:

<match url="^exception$|(.*/)exception$" /> 

和動作:

<action type="Rewrite" url="/{R:1}exception.php" />