title: How to create friendly URL in php?
body: <p>Normally, the practice or very old way of displaying some profile page is like this:</p>
  
  <pre><code>www.domain.com/profile.php?u=12345
  </code></pre>
  
  <p>where <code>u=12345</code> is the user id.</p>
  
  <p>In recent years, I found some website with very nice urls like:</p>
  
  <pre><code>www.domain.com/profile/12345
  </code></pre>
  
  <p>How do I do this in PHP?</p>
  
  <p>Just as a wild guess, is it something to do with the <code>.htaccess</code> file? Can you give me more tips or some sample code on how to write the <code>.htaccess</code> file?</p>