Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I like regular expressions problems, try this.</p> <pre><code>&lt;system.webServer&gt; &lt;rewrite&gt; &lt;outboundRules&gt; &lt;clear /&gt; &lt;rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1"&gt; &lt;match filterByTags="A, Form, Img" pattern="^(.*/)([^\.]+)\.aspx\?ID=([^=&amp;amp;]+)&amp;amp;(?:amp;)?FriendlyURL=([^=&amp;amp;]+)$" /&gt; &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="true" /&gt; &lt;action type="Rewrite" value="{R:1}{R:2}/{R:3}/{R:4}/" /&gt; &lt;/rule&gt; &lt;rule name="OutboundRewriteUserFriendlyURL2" preCondition="ResponseIsHtml1"&gt; &lt;match filterByTags="A, Form, Img" pattern="^(.*)\?ID=([^=&amp;amp;]+)&amp;amp;(?:amp;)?FriendlyURL=([^=&amp;amp;]+)$" /&gt; &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="true" /&gt; &lt;action type="Rewrite" value="" /&gt; &lt;/rule&gt; &lt;preConditions&gt; &lt;preCondition name="ResponseIsHtml1"&gt; &lt;add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /&gt; &lt;/preCondition&gt; &lt;/preConditions&gt; &lt;/outboundRules&gt; &lt;rewriteMaps&gt; &lt;rewriteMap name="Article Rewrite"&gt; &lt;add key="Article.aspx?ID=1&amp;amp;FriendlyURL=whatever" value="/1/whatever" /&gt; &lt;/rewriteMap&gt; &lt;/rewriteMaps&gt; &lt;rules&gt; &lt;rule name="RedirectUserFriendlyURL1" stopProcessing="true"&gt; &lt;match url="^([^\.]+)\.aspx$" /&gt; &lt;conditions&gt; &lt;add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /&gt; &lt;add input="{QUERY_STRING}" pattern="^ID=([^=&amp;amp;]+)&amp;amp;FriendlyURL=([^=&amp;amp;]+)$" /&gt; &lt;/conditions&gt; &lt;action type="Redirect" url="{R:1}/{C:1}/{C:2}" appendQueryString="false" /&gt; &lt;/rule&gt; &lt;rule name="RewriteUserFriendlyURL1" stopProcessing="true"&gt; &lt;match url="^([^/]+)/([^/]+)/([^/]+)/?$" /&gt; &lt;conditions&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="{R:1}.aspx?ID={R:2}&amp;amp;FriendlyURL={R:3}" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; &lt;urlCompression doStaticCompression="false" doDynamicCompression="false" /&gt; &lt;/system.webServer&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload