0

Recently I cam across a scenario.

When I tried to access the below URL on the host server, it gave me a 500 internal server error.

<DomainAddress>/tut/Courses/CoursesView

But when I change the URL as below it worked(Changed 't' to 'T').

<DomainAddress>/Tut/Courses/CoursesView

I understand that tut is a folder on the server.

  1. While trying to access an application do capital letters matter ?
  2. Am I missing some settings in the IIS server ?

Project details

  • MVC application.

  • CourseView is a HttpPostMethod.

  • Also the following url works on my localserver

    /Courses/CoursesView

neehu
  • 122
  • 9
  • Does this answer your question? [Should URL be case sensitive?](https://stackoverflow.com/questions/7996919/should-url-be-case-sensitive) – Amith Jul 09 '21 at 06:44
  • So URLs are supposed to be case sensitive. This does not answer my questions because I am trying to understand why captilization matters in a url . – neehu Jul 09 '21 at 07:28

1 Answers1

1

Section 6.2.2.1 of RFC 3986 says that "scheme and host are case-insensitive and therefore should be normalized to lowercase. For example, the URI HTTP://www.EXAMPLE.com/ is equivalent to http://www.example.com/.

Some web servers (usually Unix servers) consider all URLs to be case sensitive. That is, they would treat each of the following URLs as referring to a different file and web page:

http://www.example.com/mypage.html

http://www.example.com/MyPage.html

http://www.example.com/MYPAGE.html

http://www.example.com/MYPAGE.HTML

If you visited “http://www.example.com/mypage.html” but the file was actually named “MyPage.html”, these kinds of servers would display a “file not found” error.

But other web servers (mostly Windows servers) would treat all these URLs as requests for the same file, because they use a file system that doesn’t care about capitalization. Using an incorrectly capitalized link on these kinds of servers doesn’t cause an error.

A server might also normalize the passed URI internally and serve the same resource for URIs of different case (/about/ and /ABOUT/), making an URI appear case-insensitive to the user.

Amit Kotha
  • 1,641
  • 1
  • 11
  • 16