Killersites.com - Browser Behaviors

Browser Behaviors

Why is the Text:'%20' Being Inserted into some URLS?

Recently, someone was wondering why the browser kept inserting this text in his URLs:

%20

This code (%20) tells the browser there is a white space in between the text. Take for example the following html file that someone created and named it:

top ten.htm

The browser will insert the code %20 in the URL to deal with the space in the file ‘top ten.htm’ like so:

http://www.somesite.com/Top%20ten.htm

The bottom line is that there should be no white spaces in an url, and that includes your HTML file names.

Sometimes people make this mistake of leaving a space because the name of the file would be hard to read otherwise. A good trick around this is to capitalize the second word in the file name and to keep the first letter of the first word in lower case:

topTen.html

Another good way is

top-ten.html

This is a common way to name files and is especially popular with Java programmers

By: Stefan N. Mischook

Top
© 1996 - Killersites.com – All rights reserved