Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

%20 in Url String - Good, Bad or just Ugly?

Status
Not open for further replies.

EvilAsh

Technical User
Oct 22, 2005
56
GB
This question may prove to be threefold, so please bear with me!

Recently I have recoded my sites to include keywords in the url string as opposed to product id, i.e.

Code:
product.php?id=1234
becomes
Code:
product.php?product=shoes

The problem (if indeed it is a problem)is where there is more than one word in the product name, so the browser will render the url:
Code:
product.php?product=red%20shoes

My questions are:

1. Does the %20 in the rendered url "pollute" the keywords from an SEO perspective (as well as looking ugly!)?

2. If yes, would it be more advantageous to separate the words with a hyphen?

3. Is there a method of replacing the space between the words in MYSQL so I don't have to reopen each DB entry and do it by hand?

Thanks for reading. Any advice would be appreciated.
 
on 1 and 2- i think you may be best served by the SEO forum (forum828)

on question 3 - yes you can, but you'll be best served by the mysql forum (forum436)


 
Topic duly moved. It kinda crossed a few disciplines so I picked PHP as a starting point!
 
no worries.

you might also consider changing your url structure so that the querystring was part of the unc and then use mod_rewrite to parse it for you. e.g.

alternatively think about "product=shoes&colour=red" which gives you more granularity for searching quite apart from any SEO impact (which i suspect will not be heavy from the introduction of the %20)
 
I will add to jpadie's comment that the SEO friendly /path/path/path/path approach will earn you far more points than a long GETSTRING will.

D.E.R. Management - IT Project Management Consulting
 
You may want to read up on php's functions "urlencode" ( and "urldecode" (
Using these functions, you could grab any string of characters from the db, and apply the php functions (mentioned above) before you insert them into any URL addresses. This way you won't need to modify any db data.

Good luck.

sites I like: .. let's me find new movies to watch :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top