The GoLive release of URL Rewrite Module is now available and has a lot of improvement thanks to the IIS Community feedback (and tons of internal brainstorm meetings!). A new feature is the ability to create Rewrite Rules by using Rewrite Templates, Rewrite Templates are UI extensions that help to simplify the creation of rules.
URL Rewrite Module includes 3 templates and more interesting, it allows you to add your own Rewrite Template.
Take a look to the following walkthrough if you haven’t play with Rewrite Templates:
I want to show you how easy is to write your own Rewrite Template extension, here is how this demo should look like:
As you know, iis.net has already some good articles that explain how to create an IIS Manager UI Module, so allow me to reuse the following article:
Follow the article above and once you are done with it, please do the following changes.
- Add the assembly Microsoft.Web.Management.Rewrite.Client.dll to your C# project. If you can’t find the assembly reference in the GAC, download it from here.
- Replace the code in DemoModule.cs by the following code that registers your extension in the URL Rewrite UI Module:
- Add a new file named DemoRewriteTemplateFeature.cs and copy and paste following code:
internal sealed class DemoRewriteTemplateFeature : RewriteTemplateFeature
private const string FeatureTitle = “Rewrite Extensibility Demo”;
private const string FeatureDescription = “Demonstrates the UI Extensibility.”;
public DemoRewriteTemplateFeature(Module module)
: base(module, FeatureTitle, FeatureDescription, null, null)
public override void Run()
Form form = new Form();
form.Text = “URL Rewrite Extensibility Demo”;
form.StartPosition = FormStartPosition.CenterParent;
Colorized by: CarlosAg.CodeColorizer
internal sealed class DemoModule : Module
protected override void Initialize(IServiceProvider serviceProvider, ModuleInfo moduleInfo)
IExtensibilityManager extensibilityManager = (IExtensibilityManager)
Download the demo from here:
To install it, you will need to GAC the assembly RewriteExtensibilityDemo.dll and register the module in administration.config by adding the following entry under the moduleProviders section:
type=”ExtensibilityDemo.DemoModuleProvider, RewriteExtensibilityDemo, Version=184.108.40.206, Culture=neutral, PublicKeyToken=8975c3932a2fc4ae” />