title: htaccess: Possible to make if queries for the same url?
body: <p>I need to query an URL for the included ID and then redirect to different files according to the ID. I tried with RewriteCond %{QUERY_STRING} but it's not working out. Please help.</p>
  
  <p>This is the sample URL which needs to be redirected:
  <a href="http://www.example.com/people/123456.html" rel="nofollow">http://www.example.com/people/123456.html</a>, where 123456 is the user ID.</p>
  
  <p>If user ID is >= 300000 and &lt;= 399999, 
  redirect to <a href="http://www.example.com/people/profile-old.php&amp;userid=xxx" rel="nofollow">http://www.example.com/people/profile-old.php&amp;userid=xxx</a></p>
  
  <p>If user ID is >= 400000 and &lt;= 499999, 
  redirect to <a href="http://www.example.com/people/profile-1.php&amp;userid=xxx" rel="nofollow">http://www.example.com/people/profile-1.php&amp;userid=xxx</a></p>
  
  <p>Else redirect to <a href="http://www.example.com/people/profile-2.php&amp;userid=xxx" rel="nofollow">http://www.example.com/people/profile-2.php&amp;userid=xxx</a></p>