January 9th, 2013, 05:16 AM
SEO friendly url with parameters?
I'm planning to overhaul a website to use friendly urls. The problem I have and can't quite find a solution for is how to carry extra parameter info with a friendly url?
To explain further, say on one page, search.aspx there is a paged grid of events and some drop down boxes or text boxes so the user can filter/search on events in the grid. For example: select box - months (Jan-Dec) text box - keyword search
When an event is selected it goes to the detail page but in the querystring it passes the filter selections so these can be preset when returning to the page. For example the old url might be detail.aspx?month=1&search=quiz&page=3&eventid=30. On detail.aspx we can have a link back to the search page e.g. search.aspx?month=1&search=quiz&page=3 to preset the search as the user left it.
But, I only want the friendly url to be something like, event/[event-id]/[event-title] such as: event/30/quiz-night-at-the-royal-oak. So the friendly url will not contain the user search options.
I realise I could have event/[month]/[search text]/[page]/[event-id]/[event-title] but this seems wrong and is not the unique url for the event.
I was wondering if something like event/30/quiz-night-at-the-royal-oak?month=1&search=quiz might work? But again, seems untidy?
I know the search params could go in a session variable, but wanted to avoid that option.
Any advice on the best way to work this?
January 9th, 2013, 05:36 PM
This is the most logical way to do it.
The point of the path part of the URL is to uniquely identify the resource. /event/30/quiz-night-at-the-royal-oak/ does that. month=1 and search=quiz have nothing to do with uniquely identifying the resource, they are simply extra parameters. Thus it is completely proper to include them as query string parameters and it does not make sense to include them as part of the path.