Pre-requisites for Using the URL Rewrite Module
Prior to configuring URL Rewrite rules, check if the following are in place:
Make sure that you have access to the IIS Manager console.
Download and install the URL Rewrite module on the IIS web server. To download this module, go to the URL: http://www.iis.net/downloads/microsoft/url-rewrite
Check whether compression (static and/or dynamic) is enabled for the web site/web application that is to be RUM-enabled. To perform this check, refer to the procedure detailed in
theHow to Check Whether/Not Compression is Enabled? topic.
If Compression is enabled, then additionally, perform the following steps:
First, verify whether the target web application is a 32-bit application or a 64-bit application. For that, refer to
theVerifying Whether Web Application is a 32-bit or 64-bit Application topic. If the target web application is a 32-bit application that is running on a 64-bit machine, then execute the following command at the command prompt:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432node\Microsoft\Inetstp\Rewrite /v LogRewrittenUrlEnabled /t REG_DWORD /d 0
On the other hand, if the target application is a 64-bit application running on a 64-bit machine, then execute the following command at the command prompt:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v LogRewrittenUrlEnabled /t REG_DWORD /d 0
Next, make sure that the dynamicCompressionBeforeCache property is set to false for the /system.webServer/urlCompression configuration element. For this, add the following entry in the web.config file as depicted by .
<urlCompression doStaticCompression=”false” doDynamicCompression=”true” dynamicCompressionBeforeCache=”false” />
Figure 99 : Setting the dynamicCompressionBeforeCache property to false
Alternatively, you can run the following command from the command prompt:
appcmd.exe set config "WEBSITENAME" -section:system.webServer/urlCompression /dynamicCompressionBeforeCache:"False"
Re-order the IIS modules to have URL Rewrite module (RewriteModule) run before Dynamic Compression module (DynamicCompressionModule). In other words, in the modules ordered view of the IIS Manager console, the Dynamic Compression module should be above the URL Rewrite module.