File Naming Problem

  • Thread starter Thread starter Techman
  • Start date Start date
T

Techman

Dear friends,
I have a website where I advertise products and services and they are in
categories, so each page I make takes a lengthy name, like
Suppose my website is www.onlineproducts.freehostia.com now there is a
category health and wellness and within that category there is a sub-category
nutritional supplements, now my URL would look like this with these pages
www.onlineproducts.freehostia.com/health and wellness (nutritional
supplements page 2).htm
but instead of this the URL which is shown in the browser is like this:
www.onlineproducts.freehostia.com/health%20and%20wellness(nutritional
supplements%20page%202).htm

Where ever there is a space in my filename its replaced with a %20 sign.

How can I rename my files so that this sign wouldn't appear or any other
method of renaming that you could suggest?
 
Where ever there is a space in my filename its replaced with a %20 sign.

How can I rename my files so that this sign wouldn't appear or any other
method of renaming that you could suggest?

Don't use spaces.
 
Rename all files and folders that have spaces in them with dashes or
underscores to eliminate the browser representing the space with %20. For
example, "health and wellness" could be renamed "health_and_wellness".
 
Try to only use alphanumeric characters that are either a-z (caps or no
caps) or 0-9. A dash - or underscore _ are also legal stay away fro others
just to keep out of trouble.. There's actually a standard for how URLs are
handled and what are legal characters. A space is not a legal character for
example. To represent a space, the standard uses %20. Not all browsers are
smart enough to add this in automatically. IE is, but some others don't. Get
rid of the spaces by replacing them with a - or _. Don't use the parenthesis
either just to play it safe.
 
Mark Fitzpatrick said:
Try to only use alphanumeric characters that are either a-z (caps or no
caps) or 0-9. A dash - or underscore _ are also legal stay away fro others
just to keep out of trouble.. There's actually a standard for how URLs are
handled and what are legal characters. A space is not a legal character for
example. To represent a space, the standard uses %20. Not all browsers are
smart enough to add this in automatically. IE is, but some others don't. Get
rid of the spaces by replacing them with a - or _. Don't use the parenthesis
either just to play it safe.


--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression


Thanks friends for your suggestions.
I was also thinking of using underscore and dash and now you encouraged me
further, but what about the sub-categories, what would you say if i put them
in brackets?
 
Brackets are also an illegal character in a URL. Maybe using two underscores
together to denote a seperator or a dash and an underscore together since
they are the safest non-alphanumeric characters you can use.
 
Thanks Mark Fitzpatrick for your support.
One last thing i wanna ask is about parentheses, you mentioned that they are
not safe to play with but actually are they legal to be used and by the way
what's so wrong in using them?
 
Back
Top