Microsoft URL rewrite module is extremely easy to use not like Mod_rewrite!
Requirement: IIS 7
* Rules-based URL rewriting engine.
* Regular expression pattern matching.
* Wildcard pattern matching.
* Global and distributed rewrite rules.
* Access to server variables and HTTP headers.
* Rule templates.
* UI for testing of regular expression and wildcard patterns.
* UI for managing rewrite rules and rewrite maps.
* GUI tool for importing of mod_rewrite rules.
* and much more!
Once this module is installed there are three templates available when you add a new rule and they are:
# User-Friendly URL
# Rule with Rewrite Map
# Request Blocking
With these templates, it will make doing rewrite rule really simple! Plus the UI for testing and importing from mod_rewrite are extremely helpful.
Steps to add new rule:
# Go to IIS Manager
# Select “Default Web Site”
# In the Feature View click “URL Rewrite“
# In the “Actions” pane on right-hand side click on “Add rules…”
# In the "Add Rules" dialog, select the "user-friendly URL" and click "Ok"
Create a test page:
Copy the following ASP.NET code and put it in the %SystemDrive%\inetpub\wwwroot\ folder in a file called article.aspx:
<%@ Page Language="C#" %>
URL Rewrite Module Test
URL Rewrite Module Test Page
<%= Request.ServerVariables["HTTP_X_ORIGINAL_URL"] %>
<%= Request.ServerVariables["SCRIPT_NAME"] + "?" + Request.ServerVariables["QUERY_STRING"] %>
Testing the rule
To test that the rule redirects requests correctly, open a Web browser and request the following URL:
There are so much more you can do with it!
You can download it here: http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691
You can get more information here: http://learn.iis.net/page.aspx/734/url-rewrite-module/