As you create files for the web understanding the rules governing the naming is vitally important. If your files are not named correctly certain pages might become inaccessible or just not work properly. Remember the web pages contain links to other web pages and assets. If file naming isn’t handled correctly your site’s functionality can really suffer. Fortunately, the rules for file naming conventions on the web are pretty easy to follow.
First, don’t use any spaces in your file names. If you ever file these longer than one word use ‘_’ underscore or – hyphen to separate the word. Most web servers will allow file names with spaces but when link is resolved, the special character percentage 20 can sometime used in place of space. This is really messy and can lead to a lot of confusion when sending links or displaying your rules. Second, shorten the file name if you can, rather than ‘about_us.htm’ how about just ‘about.htm’? Shorter names are easier to remember and makes URLs easier for clients to type. Next, avoid using special characters, no dollar signs ‘$’, exclamation points ‘!’, forward or back slashes, question marks or periods or really any other special characters punctuation. Many of these symbols are used to denote things like directory structure, URL parameters or other meanings that you could unwillingly trigger. Numbers are okay to use in file names just avoid using them as the first character. Also avoid uppercase letters if possible. Most web servers won’t care but some unique servers are case sensitive and links could not be result correctly even it spells correctly. When using extensions just be consistent, for non dynamic web sites it’s okay to either use dot htm or dot html. To avoid having worry about it you can set up a default extensions in Dreamweaver preferences and Dreamweaver will resolve the extension for you.
0 comments:
Post a Comment