title: 301 Redirecting from old page to new page on Apache not working
body: <p>A simple 301 redirect is not working in this instance - For example:</p>
  
  <pre><code>Redirect 301 /oldpage http://www.mysite.co.uk/newsubdir/newpage
  </code></pre>
  
  <p>The site is dynamic and the .htaccess is already renaming pages to search engine friendly URL's from URL's containing a query string.</p>
  
  <pre><code>RewriteRule ^(.*)/(.*)$  index.php?page_name=$1&amp;sub=$2 [NC,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
  RewriteRule (.*)([^/])$ http://www.mysite.co.uk/$1$2/ [R=301,L]
  </code></pre>
  
  <p>When we are using these 301 redirects like above in the same .htaccess (at the bottom), the pages are redirecting but the query string is getting added to the end of the URL frustratingly and we have not figured out why or how to prevent it.</p>
  
  <p>After 301 redirect, URL is looking like:-</p>
  
  <pre><code>http://www.mysite.co.uk/newsubdir/newpage/?page_name=old-page&amp;sub=
  </code></pre>
  
  <p>...Causing a 404 error - it's just the query string added on the end of the URL's that is breaking the redirect.</p>
  
  <p>Please can anyone advise on what needs to be done to fix this?</p>
  
  <p>Thanks</p>