Lately I have been noticing that “File Naming” is something that not everybody understands. I am not talking about files on your computer but rather files that are used on “Websites” and even the urls of the “Web-pages” themselves.
The first thing to consider is file extensions. For some platforms they are not case sensitive, but for “Web Design” they are. So “JPG” is not the same as “jpg” and some ( not all ) web browsers won’t find the file if the extension doesn’t match ( case included ). Best practice is to keep the extension in the lower case and never mix cases ( i.e Jpg ).
One of the most common errors I see is people leaving spaces in the file names or page names. For file names, if you want to leave space for your persoaln files that is fine but for files that are going to be used on your website you need to remember that the file is going to be a “Link” ( the web-page where the file is going to be shown or used will be calling the file by its name, just link to a web-page itself) .
For “Web-pages” you can never leave spaces. A “Web Browser” will try to fill in the spaces with characters (% $ * ) and all browsers won’t use the same ones so if you try to link to you page some where else you may end up with a “Page Not Found” error.
So you should use “Hyphens” (-) in-between the words of you “web-page” names ( I explain why further on ). Also you should keep the names short and sweet, removing the smaller words ( a, to, the, and, it ) a page name shouldn’t be more then 15 words long ( I have seen ones that are 50-60 words long ) and the shorter the better.
The same rule applies to naming folders on your site. There should be no spaces and short as possible. The next is the use of “Under Scores” in the file name or in page names. For file names you should never use “Under Scores” only use “Hyphens” (-) in-between words. This is for “SEO” purposes, as search engines would not “translate” “Under Scores” into spaces when crawling pages, so if your page is “my_stuff.html” to be found in a search the person would have to be looking for “my_stuff” ( with the Under Score ) , but a “Hyphen” is seen as a space so people would only have to search for “my stuff” to find you. This also works for images and other file ( pdfs, text files ) that you use on your site.
The last item is one that I find very annoying, it is when people use “Periods” (.) in the file names for files or web-pages. The reason you should never do this is that the “Period” is seen as the end of the name and where the extension starts. So “1.image.jpg” can be seen as a file with the extension of “image” , and some times the last “Period” and the extension can disappear.
This can cause problems when trying to share files, or putting files on your website ( causing “Page not Found” errors, or images not showing because the extension is incorrect ). It can be worse if you use them in your page names because you will get errors saying your “Browser” can’t open the page because it doesn’t understand the extension of the page.
So if you remember these few rules, you will cut down on your problems and save yourself time and head-aches.