title: htaccess check length of a part of a query string
body: <p>I want apache to skip certain rewrites in case part of a request is shorter than 255 characters (has to do with caching and the 255 character filename limit in linux).</p>
  
  <p>I've written this:</p>
  
  <pre><code>RewriteCond %{QUERY_STRING} "utm_campaign" 
  RewriteCond %{QUERY_STRING} "utm_medium" 
  RewriteCond %{QUERY_STRING} ^(.*\/)([^\/\n]{0,255})$ 
  RewriteRule .* - [S=2] 
  </code></pre>
  
  <p>And I tested the regex against the url (<code>q=path/to/page?utm_campaign=xxx&amp;utm_medium=xxx</code>) and it matches but the query_string variable seems to have a different content because the 2 rules after this still get executed. The part that should match is in this case <code>page?utm_campaign=xxx&amp;utm_medium=xxx</code> (and everything after this) If this is shorter than 255 characters the next 2 rewrite rules can be skipped.</p>
  
  <p>I'm using Drupal 6 btw.</p>