I found this website have nice URLs. But I don't know how to create routes like that. My format is like:
www.domain.com/{country}/{category-name} ---> www.domain.com/japanese/restaurant
www.domain.com/{country}/{restaurant-name} ---> www.domain.com/japanese/the-best-sushi-of -japanese
Any suggestions?
Agree with Jammer that http://attributeroute.net is the way to go. However I think what you would be after is the following...
However, the two routes you have ARE IMPOSSIBLE to work together. How do you work out that "the-best-sushi-of -japanese" is a Category or a Name of a Restaurant, without first going to the database. Since Routing happens BEFORE the controller, and hence the database, thus you don't have the information required to do the correct Controller Action.
MVC routing works on pattern matching, so you need the two routes to have different PATTERNS. One way you could do this is...
Finally though. Is there any reason why you NEED the country with the restaurant name? If you assume that there is the possiblity of multiple restaurants with the same name, then surely it is more likely within the same country...