IIS7 and Enforce lowercase URLs

我是研究僧i 提交于 2020-01-06 01:30:34

问题


I tried to use option in iis7 Enforce lowercase URLs, but when i enabled it all images that had *.JPG extension (uppercase) stopped server. in prev version of iis it was ok when using upper and lower cases, it returned same source

may i fix it? or should i create rule for each extension like (jpeg, jpg, gif...)


回答1:


I was just reading an article on writing rules, from Scott Gu

Tips/Trick: Fix Common SEO Problems Using the URL Rewrite Extension

He talks about the issue of excluding static files (.jpeg, .jpg, .gif, etc.) from the lowercase rewrite, and shows how you can add conditions to exclude files. Another article is where I found the condition for excluding more than just Scott's example

Mike's Umbraco blog - URL Rewriting and SEO

He adds the condition:

<add input="{URL}" pattern="^.*\.(axd|css|js|jpg|jpeg|png|gif)$" negate="true" ignoreCase="true" />

I hope this helps you in future rewrites.



来源:https://stackoverflow.com/questions/2787053/iis7-and-enforce-lowercase-urls

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!