2013-02-23 150 views
0

我們有一些電子郵件有人發出了他們搞砸網址是/pagename.aspx/?email=emailaddress的IIS重寫規則刪除斜槓

代替/pagename.aspx?email=emailaddress

我需要一個重寫規則刪除.aspx後的斜線,有誰知道該怎麼做?

+0

您是否嘗試過的東西?您可以在IIS管理器中創建規則。 – cheesemacfly 2013-02-23 16:38:53

+0

這就是問題,重寫規則格式是什麼。我們最終使用絕對URL作爲頁面正在工作,但不是圖像。 – fizgig 2013-02-24 18:13:18

回答

1

你應該在你的web.config中插入這條規則:

<rule name="RemoveTrailingSlashRule" stopProcessing="true"> 
    <match url="(.*)/$" /> 
    <conditions> 
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
    </conditions> 
    <action type="Redirect" url="{R:1}" /> 
</rule>