Experimenting with URL rewrites using this module, however I\'m getting the following error when attempting to hit the URL. Looked online for answers, but not sure what the
I've tried the comments by aracntido, but it doesn't seem to work in IIS7. It works fine on servers with IIS7.5, so I'm not sure whether there is a work around.
The fix is to use this in the web.config:
<system.webServer>
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
</system.webServer>
This is by design, it means that the HTML was already zipped when it became available for the URL Rewrite module, so it couldn't rewrite it because it would have to unzip it first, rewrite it and then zip it again and that is too much processor power. If it is dynamic content, try to rewrite it before compress it.
Move Dynamic Compression module after URL Rewrite module in "Modules" at server level (InetMgr). Disable "log rewritten URL" for the rule (default), otherwise the module will try to be the last one in the pipeline.
Static compression is not compatible with outbound rewriting.
Switching off static compression (unnecessary for my situation) in IIS 7.0 fixed a similar problem where URLs would load but a page refresh would produce a basic error 500.
I added index.html to the URL and this refined the error to 'HTTP Error 500.52 - URL Rewrite Module Error. Outbound rewrite rules cannot be applied when the content of the HTTP response is encoded ("gzip")' error.
Thanks to aracntido for pointing this out, you helped me nail the problem.
Although disabling static and dynamic compression works nicely this method are not working with *.axd
files. This files are client side resources, like js, Ajax and so on.
Read more on axd files HERE.
Because this files are compressed automatically. Read HERE more about why!
So easier way to make them work is sending request with setting Accept-Encoding
header to empty! This is possible in two ways:
Accept-Encoding
in header! HOW?