Many servers have the option to distinguish file names based on the case of the letters that make up the file name. Web Hosting Hub servers are Linux-based and use case sensitivity on all hosting servers. The following article gives a quick summary of how this can affect your file names and advice on how to avoid the issue using best practices when developing your website.

File Names and Case Sensitivity

One of the most puzzling things about case sensitive issues for files names is that it will not always display an error explicitly describing the problem Additionally, it will list the file, but unless you happen to NOTICE that the letters have a different case, you may miss it entirely. Here's an example:

FirstNameAbc.jpg

firstnameabc.jpg

In the first name, you can see that the "F", "N" and "A" are capitalized, but the second name is ALL in lower case. If these two files were in the same folder, they would be considered two DIFFERENT files due to the difference in case.

File extension

File extensions are part of the file name and therefore they are also affected by case sensitivity. Here are some examples of file extensions:

.Web_file.HTML

This is different from:

web_file.html

The files above show the HTML extension displaying how it can be set with different case.

Image extensions should also match in spelling:

image.jpg

Is Not the same as:

image.jpeg

Although the extensions BOTH indicate a JPEG file, the JPG extension is still spelled differently from the other JPEG, so these file names would be handled as two different file names.

Best practice for Linux file naming

If you are working with your files in File Manager, an FTP client like FileZilla, or the command line (on VPS/Dedicated servers) we recommend following the best practices for file naming. See the below:

  1. Name all your files lower case.
  2. Instead of using a space, use an ( _ ) or a ( - )
  3. Use consistent file types. Use jpg or jpg. Don't use both.
  4. Only alphanumeric characters, periods, underscores and hyphens and don't use symbols like “%”, “$”, and so forth.
  5. Do not use very long file names.  Advise that the use of very long file names can cause issues with the file.

Creating file naming standards

You do not have to use the Linux best practices - that is completely up to you.  However, to avoid the issues that you can see with case sensitivity, it is important that you establish a standard for the naming of your files. This becomes very important if you are working with more than one person. Different people may have different ideas on how to name your files. Simply establish your file name standards before the project starts and ensure that people know and are aware of the standards. This will help to minimize file naming issues and prevent your from having to track down possible issues that could easily have been avoided by simply naming the files in uniform way.


Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.