title: Keep SEO URL but send the id from the database
body: <p>I'm having some troubles with the .htaccess and SEO URL (aka URL rewrite). For instance I have a list of categories like (extracted from the database) :</p>
  
  <pre><code>id   name
  1    category template
  2    category-template
  3    category template
  4    category-template
  </code></pre>
  
  <p>I have some duplicate names, and judging by the lowercase and replacing spaces with "-" in the url I have all the fields from the database resulting in the same format (lowercase and replace " " with "-").</p>
  
  <p>My actual .htaccess file looks like this:</p>
  
  <pre><code>Options +FollowSymlinks
  RewriteEngine on
  
  RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?page=$1
  </code></pre>
  
  <p>Is there some way that I can generate a url like <code>www.website.com/category-template</code> and by clicking on that the next script will get through <code>$_POST</code> variable the id from the database (for instance: 3)? I have 4 "identical" rewrites but each with a distinct id in the database and I want to retrieve the id of the correct one.</p>
  
  <p>Thank you!</p>
  
  <p>LE: I want to keep the URL very clean, like <code>www.website.com/category-template</code>, although there is a simpler way of doing it by inserting the id like: <code>www.website.com/id/category-template</code> or <code>www.website.com/category-template-[+id]</code>.</p>