2009-07-06 149 views
3

好吧,這是推動我堅果...我試圖重寫我的網址是這樣的:IIS URL重寫

Now: 
http://www.somedomain.com/Somepage.aspx 
http://www.somedomain.com/AnotherPage.aspx 

Desired: 
http://www.somedomain.com/somepage/ 
http://www.somedomain.com/anotherpage/ 

誰能幫我這個?用戶界面中的術語令人困惑。

謝謝。

回答

3

我找到了答案:

<rewrite> 
    <rules> 
    <rule name="Redirect" stopProcessing="true"> 
     <match url="^([^\.]+)\.aspx$" /> 
     <conditions> 
     <add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" /> 
     </conditions> 
     <action type="Redirect" url="{ToLower:{R:1}}/" appendQueryString="false" redirectType="Permanent" /> 
    </rule> 
    <rule name="Rewrite" stopProcessing="true"> 
     <match url="^([^/]+)/$" /> 
     <conditions> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
     </conditions> 
     <action type="Rewrite" url="{R:1}.aspx" /> 
    </rule> 
    </rules> 
</rewrite>