title: URL Rewrite like Stackoverflow, XenForo, IPBoard
body: <p>I was wondering how the url rewrite on for example this site works. I mean I don´t think that it is done via. modrewrite in apache or nginx. The thing I´m interested about is the id and user friendly title in one. How does it work that if the server enters only the id or the id with a wrong title, it 301 rewrites it to the right one ?</p>
  
  <p>Is there any how to about it I couldn´t find or could you explain it for me with a small example?</p>
  
  <p>For Example:</p>
  
  <pre><code>-index.php
  |--index.php?page=2
  -server.php?id=45343
  -contact.php
  
  
  
  -example.com/
  |--example.com/page/2
  -example.com/server/45343/some-random-title-to-be-user-friendly(.html)
  -example.com/contact(.html)
  </code></pre>
  
  <p>.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I would like to know how this works without modrewrite (htaccess..) as I know that e.g. xenforo isn´t using it.</p>