What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

This is not to criticize the current system - it works very well.

But I was just wondering if there were any specific technical reasons why SO is using the URL something like:

http://stackoverflow.com/questions?page=2&sort=newest

instead of the "more" MVC-like:

http://stackoverflow.com/questions/page/2/newest

or something like that?

I ask because I'm tasked with retro-fitting those MVC-style SEO-friendly URL's onto an existing Webforms app, and I was wondering about the motivation of the SO design team for going this route.

share|improve this question
    
This could be because unlike tags and questions (which do have "MVC" style paths) these are options for the same view. Maybe it's not desirable to treat those like "real" URLs from a SEO point of view, for example - but this is just me guessing –  Pëkka Sep 9 '10 at 11:45
1  
Semantics: Isn't that more aking to "RESTful URLs" as opposed to "MVC URLs"? –  Richard JP Le Guen Sep 9 '10 at 14:28

2 Answers 2

up vote 12 down vote accepted

Have you read the URI RFC? It's almost surprisingly useful reading for questions like these. Certainly, if I had your task assigned to me, I'd re-read it before I started.

Per the RFC, the path is for hierarchical navigation (enabling, e.g., relative links). It is intended to identify the resource. The query is intended to be interpreted by the resource.

Based on this, I would say that SO's URI (which, essentially, says that SO's list of questions is the resource I want, but would you please filter it down to page 2 of the newest ones) is more correct than the URI which says that I want a particular resource called new questions page 2. In particular, I think the query is almost always the right place for optional filters, especially if there are many of them.

share|improve this answer
    
I have not, as a matter of fact - thanks for the link. This is all pretty new stuff to me so I'm glad for any hints and pointers - thanks! –  marc_s Sep 9 '10 at 16:29

Well, questions/2 is the URL for question number 2. Essentially there are two different axes here... there's the "adding parameters for how we're looking at the list of questions" axis and "navigating through the list of questions" axis.

Arguably those might be better off with two different URLs to start with... but I'm not sure. It feels to me like the "navigational" model works better for URL path segments, but the "how we're looking at it" feels okay with parameters.

To think of it a different way, if we were using XML I'd consider the "page=2" and "sort=newest" as natural attributes, whereas "question 2" (and then "an answer to question 3") would be natural elements. Does that make any sense?

share|improve this answer
    
This describes pretty well what I think too. In addition, when submitting form values via GET, the resulting URL will be in the &param=value form too, so this may be a long-term architectural decision. –  Pëkka Sep 9 '10 at 12:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .