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?
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).
Thanks
IIS is case insensitive regarding virtual directories and file paths. /MAIN and /main are the same. Just like INDEX. HTM and index.
An Internet address is only case sensitive for everything after the domain name. For example, it does not matter if you use uppercase or lowercase with "computerhope.com," it still reaches the same page. However, when typing the name of the page, file, or directory in the URL, it is case sensitive.
JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters. The while keyword, for example, must be typed “while”, not “While” or “WHILE”.
In computing, if a written word such as a password is case-sensitive, it must be written in a particular form, for example using all capital letters or all small letters, in order for the computer to recognize it.
...but not for files.
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.
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 is case-insensitive to query string variable names. AGAIN, this is not IIS. It is the application (ASP.NET) that is case-insensitive.
Static file paths are not case-sensitive (due to Windows OS, not IIS):
http://example.com/sUbdiRectoRy/FILe.aspx
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"
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With