0

I am currently using Apache 2.4.4. Now, the problem is that when I am creating alias like

Alias /mysite "D:/MySite"

it doesn't work for http://127.0.0.1/MySite. So how can I make it case insensitive?

MadHatter
  • 79,770
  • 20
  • 184
  • 232

2 Answers2

2

Not with Alias but it should work with AliasMatch like this:

AliasMatch (?i)^/MySite(.*) "D:/MySite/$1"
faker
  • 17,496
  • 2
  • 60
  • 70
0

I have no idea whether you can, but you shouldn't. RFC 3986 makes it clear in s3.2.2 that the hostname portion of a URI is case-insensitive:

The host subcomponent is case- insensitive

but there's no similar comment in s3.3, which governs the Path component of the URI. In addition, s6.2.3 notes that

Some schemes define additional subcomponents that consist of case-
insensitive data, giving an implicit license to normalizers to
convert this data to a common case (e.g., all lowercase).

Both these strongly suggest to me that case-insensitivity isn't a normal part of most sections of a URI. I'm sorry that Windows has led you to expect case-insensitivity in file systems, but this is not in fact the norm, and you are advised to avoid trying to make it become so.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • 1
    I can understand the reasons for the RFC not explicitly stating file names should be case-insensitive, but I don't see a reason why this should prevent you from implementing the functionality into your own application. There may be some potential downsides, but they can probably be negated by any real need for this behavior. Unless of course I am missing a larger issue. – David Houde May 18 '13 at 10:11
  • 1
    I agree with you that if there's a clear business need for this, it might be worth doing; but the OP has given no indication of such a need. Otherwise, the RFCs lay out "what ought to happen", and with no good reason to depart from this, departure is generally (in my experience) a bad idea. – MadHatter May 18 '13 at 10:21
  • If this would be needed, a typical IIS server would not work - mine works case-insensitive – cljk May 18 '13 at 12:00
  • I didn't say it was forbidden to do this, merely that the RFC doesn't require it - and that it's not a good idea to arbitrarily extend things past RFCs *without good business reason*. Microsoft is already well-known for going past RFCs willy-nilly, and here we see the consequences - some poor user who is used to the MS-custom way of doing things finds out that the rest of the internet doesn't work that way, and has to spend time trying to force things back into the MS-extended mould. – MadHatter May 18 '13 at 15:19