title: Convert to lowercase in a mod_rewrite rule
body: <p>I would like URLs like server.com/foo to be case-insensitive.
  But server.com/foo actually gets mod_rewrite'd to server.com/somedir/foo</p>
  
  <p>(Assume that all the files in "somedir" are lower case.)</p>
  
  <p>So the question is, how to accomplish a mod_rewrite like the following:</p>
  
  <pre><code>RewriteRule  ^([^/]+)/?$  somedir/convert_to_lowercase($1)
  </code></pre>
  
  <p>PS: Here's a handy mod_rewrite cheat sheet -- <a href="http://dreev.es/modrewrite" rel="noreferrer">http://dreev.es/modrewrite</a> -- though it fails to answer this particular question.</p>
  
  <p>PPS: Thanks to 
  <a href="https://stackoverflow.com/users/58164/bee">Bee</a>
  and
  <a href="https://stackoverflow.com/users/20862/ignacio-vazquez-abrams">Ignacio</a>
  for all the help with this.
  Also, here's a related question:
  <a href="https://stackoverflow.com/questions/703709/rewritemap-activation">RewriteMap activation</a></p>