I've faced a challenging problem during deployment of an HttpModule for a Sharepoint web application that uses the method "HttpContext.RewritePath(path)" to render different CSS/images based on a specific condition that I check on.
The strange thing, which I think happens to most of us, is that it was working perfectly on the development environment but on the development environment it's not :(
After viewing the IIS logs, I've found out that when I request any CSS/image using this method, it returns "HTTP 404 Not Found". After investigating the method correctly, it turned out to be that the method works only when it's given a physical path on the hard drive.
So, I forgot that I was enabling the BLOB caching in my development environment during performance testing, so that was the resolution of the problem :)