A few months back I wrote about how I set up the URL rewriting for this blog. About two weeks ago I read some chatter on Twitter about using Dareboost to optimize one’s blog. It had several recommendations when I ran it on my site, one of them being to enable IIS compression. After some fiddling about I got it to work on my shared hosting plan, and thought nothing else of it.
Fast forward to today and I notice one part of my site isn’t working – the date picker on my very simplistic Amortization calculator isn’t working. Well the problem turned out to be, the rewriting rules I had set weren’t covering links to CSS and Script. Easy enough – I’ll just quickly add an extra outbound rule to cover this. Well, every time I added a rule it either caused the entire site or the calculator to return empty responses, which I determined were due to HTTP 500 errors. I couldn’t understand why adding a simple new rule was causing this, even when I modified it to take no action.
It turns out the problem was this – and it makes sense – you can’t have an outbound rule if you have compression enabled. IIS rewrite can’t scan for links, anchors etc. in the response if the content is compressed. But it would be great if it could somehow alert you why this is happening or perhaps inspect the site configuration and display a warning when you open the URL rewrite feature in IIS Admin.