Let’s a assume a blog with comments and the user views one blog post with a lot of comments. A nice URL to the blog post may look like:
http://www.example.com/blog/174/how_to_slug_urls
174 is the database id of the blog post. Since there are too many comments to display on one page, the comments get splitted over pages.
Is there some common way to pass the comment page parameter? Do i append it before the slug, after the slug, send it per POST, or is there some complete other way?
examples i can think of:
http://www.example.com/blog/174/how_to_slug_urls/commentpage/4
http://www.example.com/blog/174/how_to_slug_urls?commentpage=4
http://www.example.com/blog/174/how_to_slug_urls#commentpage=4 // maybe parsing with JS?
http://www.example.com/blog/commentpage/4/174/how_to_slug_urls
edit:
additional question: How to handle parameters which are not connected to the current data? e.g. refreshIntervall=30s
If a comment page is a resource, i.e. something independently addressable, which it clearly is intended to be here, then the first URL is ok. I’d make it ‘http://www.example.com/blog/174/how_to_slug_urls/commentpages/4’ though. Note the ‘s’. As in ‘http://stackoverflow.com/questions/11927056’.
And the comments for a blog post are obviously subordinate to the blog post itself, so the hierarchy is preserved in that url, as opposed to your last example.