Search code examples
asp.net-mvcurldirectoryuppercaselowercase

Does letter casing of directories and urls matter in .NET MVC?


Say I have a TitleCase directory name, but call an item within that directory using a lowercase url.

Does that have any effect or impact?

For example, does the server need to do a redirect from the incorrect lettercase to the correct lettercase?

Example

A file here: /PlugIns/CMSPages/Images/my-image.jpg

Called with: /plugins/cmspages/images/my-image.jpg


Solution

  • The routing engine isn't case sensitive.

    One thing to be wary of, if you are referring to page urls - Google treats lowercase and uppercase urls as different pages, so you want to make use of rel="canonical" to ensure Google and other search engines know it is one page, no matter whether the url is upper or lowercase.