title: Permanent Redirect without htaccess to readable SEO URLs
body: <p>I am about to change some of my URLs from <code>details.html?id=1234</code> to <code>details/1234_really_interesting_stuff</code>. The ID 1234 will be used to identify the content, <code>really_interesting_stuff</code> is just to make the URLs more readable.</p>
  
  <p>In the next step, I will replace all the links on my website referring to <code>details.html?id=1234</code> with the new URL where <code>really_interesting_stuff</code> is stored in the database. The problem I'm facing now: how can I make a google-friendly 301-redirect such that I won't have duplicate content (because google will still now old links such as <code>details.html?id=1234</code> which are also spread on other webpages). I'll have to forward to <code>details/1234_really_interesting_stuff</code>. Unfortunately, the string is only kept in the database.</p>
  
  <p>As far as I know, the only google-friendly 301-redirect is a htaccess-file. But there is no way to retrieve the information from the database in an htaccess-file. How could I solve this problem?</p>