title: Custom HTTP Header for a specific file
body: <p>I am trying to set a header for a specific file via my htaccess file in order to give my service worker access to my root. Unfortunately I don't see the header appearing... Perhaps I am not targeting the file (<a href="https://www.stefanklokgieters.nl/wp-content/themes/stefanklokgieters/serviceworker.js" rel="nofollow noreferrer">https://www.stefanklokgieters.nl/wp-content/themes/stefanklokgieters/serviceworker.js</a>) correctly?</p>
  
  <pre><code># Add custom header to single file
  &lt;Files "/wp-content/themes/stefanklokgieters/serviceworker.js"&gt;
  Header set Service-Worker-Allowed "/"
  &lt;/Files&gt;
  
  # BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  # END WordPress
  </code></pre>
  
  <p>Many thanks in advance!</p>
  
  <p>Cheers,
  Stefan</p>