URL Rewrite Outbound Rules IIS7

前端 未结 4 1630
渐次进展
渐次进展 2020-12-31 05:50

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

相关标签:
4条回答
  • 2020-12-31 06:14

    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>
    
    0 讨论(0)
  • 2020-12-31 06:14

    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.

    0 讨论(0)
  • 2020-12-31 06:19

    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.

    0 讨论(0)
  • 2020-12-31 06:29

    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:

    1. [BAD] changing your firefox setting HOW?
    2. [NICE] setting an inbound rule to clear Accept-Encoding in header! HOW?
    0 讨论(0)
提交回复
热议问题