开发者

IIS 6.0 map all requests to ISAPI except static files

开发者 https://www.devze.com 2023-04-13 02:27 出处:网络
I am rewriting urls in my ASP.net application (not mvc) using a custom module. My page urls have no extension suffix - for instance:

I am rewriting urls in my ASP.net application (not mvc) using a custom module. My page urls have no extension suffix - for instance:

http://www.mydomain.com/entity/123/entitytitle

so I therefore setup IIS to map * path to my ISAPI handler.

The problem is that because of this mapping all urls like *.png, *.jpg also mapped to the ISAPI Handler (not staticFileModule) which causes my IIS worker process do more work (and excessive cpu usage)

What is the solution in IIS 6.0? I want to map all extensions to ISAPI ha开发者_如何学编程ndler except some know static files like *.png, *.jpg ...

Thanks in advance.


You can't do exclusion based isapi mappings, so you'll simply have to include all extensions you want to map, assuming you really do want to use your existing custom module for rewriting.

I would strongly recommend that you investigate using a native ISAPI filter for rewriring URLs in IIS6, for example: http://www.isapirewrite.com/ (free and paid-for versions available)


I could not find any correct answer for this. and finally because I am using IIS 6.0 the only remaining way for me was using virtual directories for my images or styles folder. so then the static content will be served separately!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号