Possible Duplicate:
Underscores vs. hyphens in URLs
I'm going to implement a sort of "friendly url" for geography like a regex
/<region>/<city>/<category>?
and then I wonder which type is best:
/new_york
or
/new-york
I can understand advantages and disadvantages with both ways of writing the name. Which way do you think I should represent the whitespace? I'm passing on the name to a geocoding lookup that encodes the whitespace with this python code
param = {"address" : region,
"sensor" : "false"
}
encoded_param = urllib.urlencode(param)
url = 'http://maps.googleapis.com/maps/api/geocode/json'
url = url + '?' + encoded_param
result = urlfetch.fetch(url)
jsondata = json.loads(result.content)
latlng = jsondata['results'][0]['geometry']['location']
lat = latlng['lat']
lon = latlng['lng']
And the result will have the longitude and the latitude of for instance New York and doing it this way it will work for any region and city. Could you please answer, comment my whole scenario or just say if you prefer a slug like new_york or new-york.
Thanks in advance