title: REQUEST_URI rewrite incl. query string
body: <p>I have a WordPress plug-in and theme that are malforming a URL call to an external css file.  I will fix that later, but until then, I need to do a redirect so the css is getting served correctly.</p>
  
  <p>REQUEST_URI contains the full path, so why doesn't this work?</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/%22https:/fonts.googleapis.com/css?family=Open+Sans%22$ [NC,OR]
  RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/"https:/fonts.googleapis.com/css?family=Open+Sans"$
  RewriteRule ^(.*)$ https://fonts.googleapis.com/css?family=Open+Sans [R,L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p><em>Note 1</em>: I have tried several combinations of escaping characters in the RewriteCond.  Nothing works.
  <em>Note 2</em>: I am using flag [R,L] for testing, to prevent browser caching.  Will change to [R=301,L] later.
  <em>Note 3</em>: I have tested to verify that the problem is with the RewriteCond, not the RewriteRule.</p>
  
  <p><strong><em>UPDATE</em></strong>:</p>
  
  <p>OK, so this was a bad question and a dumb mistake.  Even though raw REQUEST_URI contains the query string, mod_rewrite specifically does not allow query string to be in REQUEST_URI for matching purposes.  Hence, QUERY_STRING instead.  I thought that it could be done either way.  </p>
  
  <p>I don't have a <em>true</em> query string in my REQUEST_URI -- I have the query string that is in a string that I wanted to match -- so that is why I didn't go to QUERY_STRING at the outset.  But mod_rewrite still sees the <code>?</code> as a typical query string start.</p>
  
  <p>Sorry, guys.  I can handle it like this until I fix the underlying problem in WordPress:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/%22https:/fonts.googleapis.com/css(.*)$ [NC,OR]
  RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/"https:/fonts.googleapis.com/css(.*)$
  RewriteRule ^(.*)$ https://fonts.googleapis.com/css?family=Open+Sans [R,L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p><em>With WordPress, always remember to put your rewrites above the WordPress rewrites.</em></p>