如何启用IIS防爆preSS区分大小写? [英] How to enable case-sensitivity under IIS Express?

查看:180
本文介绍了如何启用IIS防爆preSS区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该如何去实现区分大小写的请求处理,如果使用的是IIS防爆preSS?有没有在IIS防爆preSS设置?或者可以在URL重写规则做到这一点?或者包罗万象的HTTP处理程序做的情况下检查?

How should I go about enabling case sensitive request handling if using IIS Express? Is there a setting in IIS Express? or can a URL Rewrite rule accomplish this? or perhaps catch-all HTTP Handler to do the case check?

我们的目标是能够赶上不一致的情况下在当地,对于静态文件,部署IIS和S3都(其中S3是区分大小写)之前。

The goal is to be able to catch case inconsistencies locally, with respect to static files, before deployment to both IIS and S3 (where S3 is case sensitive).

感谢

推荐答案

...但不使用的文件。

IIS is case-sensitive...

...but not for files.

这是一个名不副实的IIS是不区分大小写的,它是Windows文件系统不区分大小写,而不是IIS。如果URL中包含的文件路径中,那么IIS的Windows询问如果该文件存在,操作系统不考虑字母大小写响应。有没有办法为Enable在Windows文件名大小写。

It is a misnomer that IIS is case-insensitive, it is the Windows file system that is case-insensitive, not IIS. If a URL contains a file path then IIS asks Windows if the file exists and the OS responds without regard to letter case. There is no way to "enable" case sensitivity for file names in Windows.

但比的真正的文件路径等,IIS是100%的区分大小写。网址字符的情况下被传递到IIS管道完好无损。它是由Web应用程序是否不区分大小写存在。但是良好的实践说,你不想让 /第1页是不同于 / PAGE1

But for other than real file paths, IIS is 100% case-sensitive. The case of URL characters is passed to the IIS pipeline intact. It is up to the web application whether or not case-sensitivity exists. But good practice says you don't want /page1 to be different than /PAGE1.

ASP.NET是不区分大小写的查询字符串变量名。再次,这是的的IIS。它是应用程序(ASP.NET)是不区分大小写。

ASP.NET is case-insensitive to query string variable names. AGAIN, this is not IIS. It is the application (ASP.NET) that is case-insensitive.

静态文件路径是不区分大小写(因为Windows操作系统,而不是IIS):

Static file paths are not case-sensitive (due to Windows OS, not IIS):

http://example.com/sUbdiRectoRy/FILe.aspx

不过,不参与文件路径的URL部分的的大小写(一切后, file.aspx 除了下面的 X'的参数,因为的.aspx是一个ASP.NET资源):

HOWEVER, portions of the URL not participating in the file path are case-sensitive (everything after file.aspx below except for the 'x' parameter because .aspx is an ASP.NET resource):

http://example.com/sUbdiRectoRy/FILe.aspx/Extra/Tail?x="query parameter"

这是动态地重新写,的HttpModules等生成的URL也是区分大小写如果应用程序是区分大小写的。这通常不是最好的做法,因为这两个网址,将涉及到两个独立的网页:

URLs that are dynamically generated by re-writes, HttpModules, etc. are also case-sensitive if the application is case-sensitive. This is usually not best practice as these two URLs would refer to two separate web pages:

http://example.com/2012/01/23/blog-article
http://example.com/2012/01/23/BLOG-ARTICLE

这篇关于如何启用IIS防爆preSS区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆