title: How can I escape slash sign `/` in Apache `<If>` directive's regex?
body: <p>I wanted 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>I tried doing it with <code>mod_rewrite</code> but it didn't work with <code>Options -FollowSymLinks</code> (see <a href="https://stackoverflow.com/questions/15142285/why-i-do-i-get-403-forbidden-when-viewing-files-affected-by-apache-rewriterule-i">Why I do I get 403 Forbidden when viewing files affected by Apache RewriteRule if I have `Options -FollowSymLinks`?</a>).</p>
  
  <p>Then, I tried</p>
  
  <pre><code>&lt;Files "*.xhtml"&gt;
      &lt;If "%{HTTP:Accept} !~ /application\/xhtml\+xml/"&gt;
          ForceType text/html
      &lt;/If&gt;
  &lt;/Files&gt;
  </code></pre>
  
  <p>But I get a syntax error: <em>Failed to compile regular expression</em>.</p>
  
  <p>Meanwhile, I use this code...</p>
  
  <pre><code>&lt;Files "*.xhtml"&gt;
      &lt;If "%{HTTP:Accept} !~ /xhtml\+xml/"&gt;
          ForceType text/html
      &lt;/If&gt;
  &lt;/Files&gt;
  </code></pre>
  
  <p>... which works, but I want to match the correct MIME type.</p>