title: best way to url rewrite a large website
body: <p>i have a large database and i would like to url rewrite. it is like</p>
  
  <pre><code>www.example.com/products.php?id=111&amp;cat=99&amp;f=6&amp;hjk=4545..
  </code></pre>
  
  <p>So I wrote url rewrite for this code to appear as</p>
  
  <p><code>www.example.com/men/watches/casio/latest..</code> like that and its works fine</p>
  
  <p>The problem is that I have a large database and its nearly impossible to write all url rewrites separately. </p>
  
  <p>I thought of generating <code>.htaacess</code> file automatically using php. Does that make sense? or whats the best solution for this..?</p>
  
  <p>EDIT: For @ghoti</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^/([^/]*)/check/([^/]*)/SubjectId/([^/]*)/UniversityId/([^/]*)/CourseId/([^/]*)\.html$ /dsh_course_subjects_topics.php?TopicId=$1&amp;check=$2&amp;SubjectId=$3&amp;UniversityId=$4&amp;CourseId=$5 [L]
  </code></pre>