2009-07-06 7 views
3

Ok, ça me rend dingue ... Je suis en train de réécrire mes urls comme ceci:IIS URL Rewrite

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

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

Quelqu'un peut-il me aider avec ça? Les termes de l'interface utilisateur sont sacrément confus.

Merci.

Répondre

3

Je trouve la réponse:

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