
12th Mar 09, 12:17 AM
|
| Junior Reviewer | | Join Date: Mar 2009
Posts: 1
| |
Avoid Spaces in Your Filenames One of the common beginner's mistakes when naming filenames is to put spaces in the filenames. Obviously, modern operating systems like Windows, Linux, Mac OS X, etc, allow filenames to contain spaces. On Web Designers own computer, having spaces in the filenames improve the general usability of your system, since the spaces separate out the words in the name and let you quickly locate the file you want at a glance (provided of course you named your files sensibly). However, spaces in web files are problematic. Let's take a file named "lousy web page filename.html" as an example. How do you form a web address ("URL") from such a filename? Webmasters new to URLs may think that "http://www.example.com/lousy web page filename.html" is the right form, but they will be wrong. Web browsers and search engines do not expect spaces in URLs. Every space has to be replaced by "%20" (without the quotes). The correct URL for such a file should thus be "http://www.example.com/lousy%20web%20page%20filename.html". If you use a WYSIWYG web editor like Dreamweaver or KompoZer, you may not realize this, since such web editors handle the replacement of spaces with %20 transparently for you. The problem comes when you manually add a link to that page from another page, and you forget to replace all the spaces with the encoded "%20" form. Don't think that this is an unlikely event. I can't even begin to count the number of new webmasters who have written to me asking why they get a 404 Page Not Found error when they link to another page on their site that they know exists. When they tell me the filename of that page, the answer becomes obvious. Avoid this problem by not using spaces at all in your filenames. Filenames with spaces work fine on your own hard disk. When you create files for the web, the mistakes that can happen with space-filled filenames, as well as the tedium involved repacing all those spaces with "%20", is just not worth the trouble. |