title: Apache Rewrite rule for named anchors
body: <p>I have a Polymer site for which I need to write a rewrite rule.</p>
  
  <p>Currently there is <code>example.com/index.html#contact</code>, <code>example.com/index.html#FAQ</code> and so on. It works by default in the browser as <code>example.com/#contact</code>, <code>example.com/#FAQ</code>, ...</p>
  
  <p>I want it to be accessible as <code>example.com/contact</code>, <code>example.com/FAQ</code>, ...</p>
  
  <p>I have:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)$ index.html#$1 [NE]
  </code></pre>
  
  <p>However, when I add the <code>R</code> flag to the last line it "works". Unfortunately, with the <code>R</code> flag the address becomes visible in the browser as <code>example.com/index.html#home</code> and I don't want that. </p>
  
  <p>Any suggestions?</p>