开发者

IIS7 Rewrite Rules How to Add: ignore extensions

开发者 https://www.devze.com 2023-02-09 19:43 出处:网络
I just added an new rewrite rule so I can redirect pages like: www.Domain.com/PartnerNameHere/ to: www.Domain.com/LandingPage?page=PartnerNameHere

I just added an new rewrite rule so I can redirect pages like:

www.Domain.com/PartnerNameHere/

to:

www.Domain.com/LandingPage?page=PartnerNameHere

However now all a开发者_如何学编程xd references are not working.

How do I set: ignore extensions for css,jpg,png axd..

IIS7 Rewrite Rules How to Add: ignore extensions


Current your match pattern for RewriteUserFriendlyURL1 is ^([^/]+)/?$, which makes no concession for extensions (it's matching any queries with a single URI segment).

If PartnerNameHere can never contain a ., then changing your match pattern to ^([^/.]+)/?$ should be sufficient.

If, however, you only want to block those specific extensions, you'll need to use this: ^(?![^/]+?\.(?:css|png|jpg|axd)$)([^/]+)/?$

0

精彩评论

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