title: Match Question Mark in mod_rewrite rule regex
body: <p>I am looking to rewrite urls with multiple substrings.  One substring is being requested as a subdirectory, while any others are requested as normal query string parameters.</p>
  
  <p>For example, I would like to rewrite urls from</p>
  
  <pre><code>http://www.mysite.com/mark/friends?page=2
  </code></pre>
  
  <p>to</p>
  
  <pre><code>http://www.mysite.com/friends.php?user=mark&amp;page=2
  </code></pre>
  
  <p>I am able to accomplish this with the exception of the question mark character.  Here is my rewrite rule:</p>
  
  <pre><code>...
  RewriteEngine On
  RewriteBase /
  RewriteRule ^([A-Za-z0-9-_]+)/friends[?]?([^/\.]+)?$ friends.php?user=$1&amp;$2 [L]
  </code></pre>
  
  <p>If I change the question mark to any other character it works great.  It seems like the problem is that the '?' character is being interpreted incorrectly as the start of a new query string.</p>
  
  <p>I need to pass on any parameters that appear after /user/friends as is.  How do I accomplish this?</p>