title: How to change my .htaccess to access serviceworker file from root
body: <p>To make react router work i changed the .htacsess and added the code below :</p>
  <pre><code>DirectoryIndex index.html
  
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.html [L,QSA]
  </code></pre>
  <p>then added this line</p>
  <pre><code>    RewriteCond %{REQUEST_URI} !^sw\.js$ 
  </code></pre>
  <p>to make it exclude sw.js but it doesn't seem to exclude sw.js and requesting domain.com/sw.js still serves the index.html</p>
  <p>here is my full .htaccess file :</p>
  <pre><code>DirectoryIndex index.html
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !^sw\.js$ 
  RewriteRule ^(.*)$ /index.html [L,QSA]
  </code></pre>