title: Replacing ? with # in url to avoid cache busting
body: <p>I discovered the UTM variables for Google Analytics bust our page caching. Google Analytics allows using hash instead of question mark, so</p>
  
  <pre><code>http://www.example.com/?utm_source=source&amp;utm_medium=medium
  </code></pre>
  
  <p>and</p>
  
  <pre><code>http://www.example.com/#utm_source=source&amp;utm_medium=medium 
  </code></pre>
  
  <p>Are actually the same. But, as I said, the first option busts our caching while the second does not. </p>
  
  <p>When we generate our own links, then I use <code>#</code>. However, services like Feedburner or <code>dlvr.it</code> append the UTM campaign variables with a <code>?</code> -- so I want in <code>.htaccess</code> to redirect all <code>/?utm...</code> to <code>/#utm...</code></p>
  
  <p>I know that <code>NE</code> (No Escape) should be used for the hash, but I honestly can't figure out how the rewrite condition and rule should be like.</p>
  
  <p>The rule logic should be - </p>
  
  <pre><code>RewriteCond: if {path}?{query_string} AND {query_string} has 'utm_source' as a variable,
  RewriteRule: redirect to {path}#{query_string} [R,NE,L]
  </code></pre>
  
  <p>Can anyone help me with this place?</p>