IIS URL Rewrite Module 2

Readme


Table of Contents


Overview

IIS URL Rewrite Module 2 is an incremental release that includes all the features from version 1.1, and adds support for outbound response rewriting. More specifically, it can be used to:

For more information on capabilities of the module refer to IIS URL Rewrite Module 2 Overview.


Features

IIS URL Rewrite Module 2 includes the following key features:


Installation Notes

There are two separate downloadable packages for the module; you will need to download the appropriate package for your version of Windows OS:

You will need to run the installation package as an administrator. This can be accomplished by one of the following methods:

Note:

Additional updates installed

The installation package includes several additional components and hotfixes required by URL rewriter. Refer to the KB articles for the hotfixes to get more details. In order to apply the hotfixes correctly without restarting the server, it is necessary to stop WAS service and Web Management service before installing URL Rewrite Module. To stop these services run the following command from an elevated command prompt:

net stop was /y & net stop wmsvc

Once the module has been installed run this command:

net start w3svc & net start wmsvc

The following hotfixes may be installed with URL Rewrite Module 2:

Note that the hotfix for ASP.NET System.Web.dll will be installed only if .NET Framework 3.5 SP1 is already installed on the machine. If the .NET Framework 3.5 SP1 was installed after URL rewrite module has been installed, then the hotfix can be applied by re-running the installer for URL Rewrite Module in repair mode.

Known Issues

  1. Outbound rules are not applied to chunked transfer encoded responses if rewriteBeforeCache is enabled. Set rewriteBeforeCache to false if you need to rewrite responses that are chunked transfer encoded.

Configuration settings

Using outbound rewriting with IIS compression

Outbound rewriting can only be applied on un-compressed responses. If the response is already compressed then URL Rewrite Module will report an error if any of the outbound rules is evaluated against that response.

Oubound rewriting cannot be used together with IIS static compression.

Outbound rewriting can be used together with IIS dynamic compression by using the following workaround:

  1. Set the LogRewrittenUrlEnabled registry key:
    reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v LogRewrittenUrlEnabled /t REG_DWORD /d 0
  2. Make sure that dynamicCompressionBeforeCache property is set to false for the /system.webServer/urlCompression configuration element.
  3. Re-order the IIS modules to have URL Rewrite module (RewriteModule) run before Dynamic Compression module (DynamicCompressionModule). In the IIS Manager user interface in the modules's ordered view the Dynamic Compression module should be above the URL Rewrite module.

Disabling internal caching of rewrite rules

To disable caching of inbound rewrite rules in URL Rewrite Module run the following command from an elevated command prompt:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v RewriteCacheEnabled /t REG_DWORD /d 0

Double encoding detection

You can configure UrlDecode built-in function to fail if the input data is double encoded by setting “DecodeAllowsDoubleEncoding” to 0 in the registry key. Run the following command from an elevated command prompt:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v UrlDecodeAllowsDoubleEncoding /t REG_DWORD /d 0

Disabling inbound or outbound rewrite functionality

You can configure URL rewrite to stop applying inbound or outbound rewrite rules. Execute the following commands:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v InboundRewriteEnabled /t REG_DWORD /d 0

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v OutboundRewriteEnabled /t REG_DWORD /d 0

Disabling the logging of rewritten URLs

To prevent logging of rewritten URL's in the IIS log files use the command below. The rewritten URLs will never be logged even if the rewrite rule is explicitly configured to log rewritten URLs.

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v LogRewrittenUrlEnabled /t REG_DWORD /d 0

Troubleshooting Installation Issues

If you encounter any problems during installation, you can run appropriate command listed below for your version of Windows to create a log file that will contain information about the installation process:

msiexec /L urlrewriteinstall.log /I <msi_filename>

You can analyze this log file after a failed installation to help determine the cause of the failure.

For More Information

The following additional resources for the IIS URL Rewrite Module are available on IIS.net:


© 2010 Microsoft Corporation.