views:

38

answers:

1

I have a website that has categories for the products. I wanted to have the categories defined in a route pretty much like www.domain.com/categoryA.

Here's my problem what if I have category in my database that is 'Boxing Gloves' how do I handle the space in the category name?

+2  A: 

You can have spaces encoded as %20, but that doesn't really make for pretty urls. I'd suggest you convert them to dashes and disallow dashes in category names. You could also disable spaces and force users to use dashes like most tagging systems.

jcm