6

I need URL to be CASE-INSENSITIVE in Tomcat. I mean when I write in browser's address bar for example 'http://localhost/index.htm' is not equals 'http://localhost/INDEX.htm' and then i get error because this page(INDEX.htm) there isn't. how i can config Tomcat6 for case insensitive URL? Thank you

Harsha Herle
  • 155
  • 5
HFDev
  • 131
  • 2
  • 4
  • 11
  • 1
    You know that it breaks the web when you do this kind of thing, right? – Christopher Schultz Aug 07 '12 at 14:12
  • 8
    @ChristopherSchultz No it doesn't. In the real world, people do not use case sensitive URLs. Nor should they. – Charles Boyung Dec 08 '15 at 20:17
  • 1
    @CharlesBoyung Yes, it does. In the real world, the scheme-dependent part of any URL is case-sensitive. Here's an example you may find instructive. http://www.homedepot.com/s/hammer?NCNI-5 finds hammers on Home Depot's web site, while http://www.homedepot.com/S/hammer?NCNI-5 gives you a `404 Not Found` response. – Christopher Schultz Dec 09 '15 at 17:20
  • 7
    @ChristopherSchultz And that is a bad implementation. Both of those should give you the same result. It is horrible usability that it doesn't, because real people (the "real world" I am talking about) don't want to have to worry about the case of a URL they are entering, nor should they have to. And in any good website, it shouldn't matter. Both http://smile.amazon.com/Dont-Make-Think-Revisited-Usability/dp/0321965515/ and http://smile.amazon.com/dont-make-think-revisited-usability/dp/0321965515/ give you the same product page, which is how it should be. – Charles Boyung Dec 09 '15 at 21:47
  • 6
    @ChristopherSchultz It doesn't matter that a particular website does things wrong, which Home Depot does (side note, when I built Home Depot's websites several revisions ago, the URLs were NOT case sensitive), it matters what the users expect, and users expect a URL to work regardless of the case of the characters in the URL. – Charles Boyung Dec 09 '15 at 21:50
  • Users aren't expected to enter URLs by hand, other than perhaps the hostname. Case-insensitive URLs (and filesystems!) are a great way to introduce security vulnerabilities of various kinds. The [W3C] (http://www.w3.org/TR/WD-html40-970708/htmlweb.html#h-4.1) disagrees with you. The [cookie spec](https://tools.ietf.org/html/rfc6265#section-5.2.4) disagrees with you. But I think this comes down to background: those who have traditionally worked in UNIX-style environments expect everything to be case-sensitive and those who have worked in Windows-based environments expect case-insensitive. YMMV. – Christopher Schultz Dec 10 '15 at 17:21
  • Also, [IIS](http://stackoverflow.com/questions/5811021/how-to-enable-case-sensitivity-under-iis-express) disagrees. – Christopher Schultz Dec 10 '15 at 17:26

2 Answers2

4

It is possible in Tomcat 6 and earlier, but not recommended. Refer this Link from apache documentation. Search for caseSensitive. By default it is true

Harsha Herle
  • 155
  • 5
0

A lot depends on whether you use Tomcat or Apache for HTML rendering. You can configure Apache 2.4 to render HTML and delegate JSP to Tomcat. In this scenario, you can configure Apache to be case insensitive. See this link:

Usually jsp pages are referenced by links, so the developer controls the case of the URL.

Ainsworth
  • 69
  • 3
  • 8