Showing posts with label SPECIAL CHARACTERS IN URLs. Show all posts
Showing posts with label SPECIAL CHARACTERS IN URLs. Show all posts

Wednesday, 11 February 2015

SPECIAL CHARACTERS IN URLs

 A special characters in a URL is anything that is not an upper-or lowercase letter, a number (0-9), OR one of the following symbols: dollar sign (&),dash (-, underscore (_), or period (.). you might need to specify any other characters by using special URL escape codes to keep them from being interpreted as parts of the URL itself.
URL escape codes are indicated by a percent sign (%) and a two-character hexadecimal symbol from the ISO-latin-1 character set (a superset of standard ASCII). For example, %20is a space, %3f is a question mark, and %2f is a slash. (spaces are also sometimes encoded as +signs, and +signs are encoded as %2b)
Suppose that you have a directory name all my files. Your first pass at a URL with this name in it might look like the following:
http://myhost.comharddrove/all my files/www/file.html
if you put this URL in quotation marks in a link tag, it might work (but only if you put it in quotation marks). Because the spaces are considered special characters to the URL, however, some browsers might have problems with them and not recognize the pathname correctly. For full compatibility with all browsers. Use %20, as follows:
http://myhost.com/harddrive/A||%20files/www/file.html
most of the time, if you make sourer that your file and directory names are short and use only alphanumeric characters, you won’t need to include special characters in URLs. Keep this point in mind as you write your own pages.
HTML 4.01 and the <a>TAG