title: REST Url Structure - Can ID of Resource go before controller?
body: <p>The standard template for ASP.NET MVC (and MVC in general) seems to be <em>{controller}/{action}/{id}</em>, however, on a project i'm currently working on i'm not sure if that is an appropriate structure. If for example I had an application that controlled a car, to me it would make more sense to me to have the structure below:</p>
  
  <pre><code>  {car-rego}/{controller}/{action}/{data etc}
  </code></pre>
  
  <p>This makes sense to me because the car (identified by registration plate) is the resource we are performing operations on and the logical separation of functionality is seperated into the controller and action. This would result in URL's such as:</p>
  
  <pre><code>/ESX-121/Power/On
  /ESX-121/Speed/Set/100
  /ESX-121/Speed/Current -- get the current speed (could be /ESX-121/Speed also)
  /ESX-121/Turn/Left
  /ESX-121/Speed/Set/90
  /ESX-121/Power/Off
  </code></pre>
  
  <p>If this followed the default pattern it would be something like below:</p>
  
  <pre><code>/Power/On/ESX-121
  /Speed/Set/ESX-121/100
  /Speed/Current/ESX-121 -- get the current speed (could be /Speed/ESX-121 also)
  /Turn/Left/ESX-121
  /Speed/Set/ESX-121/90
  /Power/Off/ESX-121
  </code></pre>
  
  <p>To me the first option makes it much more sense as far as readable URL's go and the resource identifier is in a constant logical place. For example <em>/Speed/Set/ESX-121/100</em> suggests to me that there is a resouce of type speed with an identifier of ESX-121 which is not really the case, the operation is on the car.</p>
  
  <p>How do you go about structuring URL's and the related controllers and actions for cases such as this? Do you think this is an acceptable solution, or is there a better way for this to be structured?</p>