title: mod_rewrite urlencoding an already urlencoded query string parameter - any way to disable this?
body: <p>We have some very basic mod_rewrite rules:</p>
  
  <pre><code>RewriteRule ^something.swf$ http://www.newdomain.com/something.swf [R=302,L]
  </code></pre>
  
  <p>mod_rewrite seems to do its job, and if the user is accessing:</p>
  
  <p><code>something.swf?param=value</code>, it is redirected correctly to <code>http://www.newdomain.com/something.swf?param=value</code></p>
  
  <p>the problem is in this situation:</p>
  
  <pre><code>www.olddomain.com/something.swf?param=URL_ENCODED_VALUE
  </code></pre>
  
  <p>what ends up happening is mod_rewrite takes it upon it self to re-urlencode the query string param</p>
  
  <p>so what the user ends up with is:</p>
  
  <pre><code>www.olddomain.com/something.swf?param=URL_ENCODED_VALUE
  </code></pre>
  
  <p>REDIRECTED TO</p>
  
  <pre><code>www.newdomain.com/something.swf?param=URL_ENCODED_VALUE_OF_URL_ENCODED_VALUE
  </code></pre>
  
  <p>so we end up with a double-urlencoded value. boourns!</p>
  
  <p>While I do understand we could make a <code>\?(.*)</code> ... <code>?$1</code> rule for this, I am thinking there must be a way to tell mod_rewrite NOT to urlencode the query string params... we would like to avoid using 2 rules since valid paths are:</p>
  
  <pre><code>something.swf (no query string)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>something.swf?someparams...
  </code></pre>
  
  <p>so yea, ideally... just tell mod_rewrite: please, no urlencoding of query string params... just direct passthru to the new URL via <code>R=302</code>.</p>