Friendly urls with iis, using url rewrites..
A ThatsIT Solutions Tutorial
Using IIS manager
The easiest way to create friendly urls, the corresponding 301 redirects and outbound rules is by using the url-rewire add-in for IIS. If you don’t have the URL rewrite tool you can download it using the Web Platform Installer. If you don’t have access to the IIS Manager you can place the code at the bottom of this page directly in the web.config file.
- Open your IIS Manager and highlight the website you want to apply the rules to.
- Double click url-rewrite.

- Click add rules from the right menu.
- Select user friendly url.

- Give the rule a name.
- Enter an example ugly url.
- Select the format you want to use from the drop-down.
- Check the Create corresponding 301 redirect rule check box.
- Check the Create corresponding outbound rule check box.
- Click ok.

That’s it all done. You can now look in your web.config and see the results.
In the web.config file
<system.webServer>
........
<rewrite>
<rules>
<rule name="RedirectUserFriendlyURL1" stopProcessing="true">
<match url="^$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^firstname=([^=&]+)&lastname=([^=&]+)$" />
</conditions>
<action type="Redirect" url="/{C:1}/{C:2}" appendQueryString="false" />
</rule>
<rule name="RewriteUserFriendlyURL1" 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="?firstname={R:1}&lastname={R:2}" />
</rule>
</rules>
<outboundRules>
<rule name="OutboundRewriteUserFriendlyURL2" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^(.*/)\?firstname=([^=&]+)&(?:amp;)?lastname=([^=&]+)$" />
<action type="Rewrite" value="{R:1}/{R:2}/{R:3}/" />
</rule>
<preConditions>
<remove name="ResponseIsHtml1" />
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
........
</system.webServer>