title: What are good practices for URL design in one page web apps (I use Dojo)?
body: <p>I'm wondering about HTML reuse when using Ajax (specifically Dojo). So let me set the context:</p>
  
  <p><b>Context</b></p>
  
  <p>Say I have index.html with some *.js included files at <a href="http://host/site/" rel="nofollow noreferrer">http://host/site/</a> that consumes some REST service say <a href="http://host/rest/xxxx/yy" rel="nofollow noreferrer">http://host/rest/xxxx/yy</a></p>
  
  <p>The <strong>user</strong> interacts with <a href="http://host/site/" rel="nofollow noreferrer">http://host/site/</a>{index.html} and everybody is happy.</p>
  
  <p>I'm pondering what happens when the user goes to <a href="http://host/site/contacts" rel="nofollow noreferrer">http://host/site/contacts</a> or <a href="http://host/site/contacts/active" rel="nofollow noreferrer">http://host/site/contacts/active</a> using different technologies. (Client state/bookmarks)</p>
  
  <p>For example in PHP one can use <a href="http://www.smarty.net/crashcourse.php" rel="nofollow noreferrer">Smarty</a> (to replace tags in a template html file) and probably use <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" rel="nofollow noreferrer">mod_rewrite</a> to clean up the url from say <a href="http://host/site.php/contacts" rel="nofollow noreferrer">http://host/site.php/contacts</a> to <a href="http://host/site/contacts" rel="nofollow noreferrer">http://host/site/contacts</a> and <a href="http://host/rest.php/xxxx/yy" rel="nofollow noreferrer">http://host/rest.php/xxxx/yy</a> to <a href="http://host/rest/xxxx/yy" rel="nofollow noreferrer">http://host/rest/xxxx/yy</a>. Thus using the URL for state/bookmarks. That's "relatively easy" since we'll re-use template.html and generate/include js code as needed in the PHP code.</p>
  
  <p>With <a href="http://rubyonrails.org/" rel="nofollow noreferrer">RoR</a> you have a nice server doing the job for you and I guess it is a similar approach as above. (It seems since I do no know Ruby or RoR.)</p>
  
  <p>So to get to the real question.</p>
  
  <p><b>Question</b></p>
  
  <p>Allowing the <strong>user</strong> to hit/bookmark the following RESTful-like resources in the app:</p>
  
  <ul>
  <li><a href="http://host/site/contacts" rel="nofollow noreferrer">http://host/site/contacts</a></li>
  <li><a href="http://host/site/contacts/active" rel="nofollow noreferrer">http://host/site/contacts/active</a></li>
  <li><a href="http://host/site/contacts/1/emails/work" rel="nofollow noreferrer">http://host/site/contacts/1/emails/work</a></li>
  </ul>
  
  <p>For the client (application state) one can thus design /site.html (purely client side) OR /site.php (server side + code generation/includes etc.)</p>
  
  <p>What would be a good way to approach this with a one page web app:</p>
  
  <ul>
  <li>Parsing window.location to determine the state/bookmark as per <a href="http://dojocampus.org/content/2009/05/17/using-dojo-back-button-and-bookmarks/" rel="nofollow noreferrer">this link</a>?</li>
  <li>Or does one not approach it like this? One needs server side "help"</li>
  <li>Should I opt for <a href="http://host/site#contacts/active" rel="nofollow noreferrer">http://host/site#contacts/active</a>? I prefer <a href="http://host/site/contacts/active" rel="nofollow noreferrer">http://host/site/contacts/active</a></li>
  </ul>
  
  <p>Any thoughts on this or some good approaches?</p>