title: Apache .htaccess redirect do not find match in url when script is in subfolder
body: <p>I have an url like "<a href="http://www.example.com/mobiles/page.php?id=999" rel="nofollow noreferrer">http://www.example.com/mobiles/page.php?id=999</a>". I want to redirect all requests on urls like this on to new ones like "<a href="http://www.example.com/mobiles/page/show/999" rel="nofollow noreferrer">http://www.example.com/mobiles/page/show/999</a>".</p>
  
  <p>I wrote .htaccess in mobiles subfolder:</p>
  
  <pre><code>Options +FollowSymLinks
  IndexIgnore */*
  
  RewriteEngine on
  
  RewriteCond %{THE_REQUEST} \s/page\.php\?id=([0-9]+)\s [NC]
  RewriteRule ^ /page/show/%1? [R=301,L]
  </code></pre>
  
  <p>But the match does not fire. What the problem is? Thanks in advance!</p>
  
  <p><strong>update:</strong></p>
  
  <p>I'm having big difficulties to write htaccess regexp which matches "page.php?id=" in url like this "<a href="http://www.example.com/mobiles/page.php?id=999" rel="nofollow noreferrer">http://www.example.com/mobiles/page.php?id=999</a>". I've checked the online htaccess testers but anything really helps...</p>