title: How can I negate a condition in Apache RewriteCond
body: <p>I want to serve .xhtml files as</p>
  
  <ul>
  <li><code>application/xhtml+xml</code> if the browser says that it accepts it.</li>
  <li><code>text/html</code> otherwise</li>
  </ul>
  
  <p>Then, I have this code:</p>
  
  <pre><code>AddType text/html .xhtml
  &lt;Files "*.xhtml"&gt;
      RewriteEngine on
      RewriteCond "%{HTTP:Accept}" "application/xhtml\+xml\s*(?:,|$)"
      RewriteRule .* - [T=application/xhtml\+xml]
  &lt;/Files&gt;
  </code></pre>
  
  <p>And it works.
  But I think it could be simplified negating the condition. Something like</p>
  
  <pre><code>&lt;Files "*.xhtml"&gt;
      RewriteEngine on
      RewriteCond "%{HTTP:Accept}" !"application/xhtml\+xml\s*(?:,|$)"
      RewriteRule .* - [T=text/html]
  &lt;/Files&gt;
  </code></pre>
  
  <p>but it doesn't work: I always get a <code>text/html</code> page, even if XHTML is supported.</p>