title: Forcing subdomain Cookieless
body: <p>When doing website speed tests, I often see a comment along the lines of:</p>
  
  <blockquote>
    <p>Serve static content from a cookieless domain</p>
  </blockquote>
  
  <p><strong>I want to ensure that data served from the <code>static</code> domain - files with extension JS, SVG, PNG, JPG and CSS - do not set cookies.</strong></p>
  
  <p>Here is a portion of my <code>.htaccess</code>:</p>
  
  <pre><code>&lt;FilesMatch "\.(js|svg|png|jpg|css)$"&gt;
      &lt;IfModule header_module&gt;
          Header unset Cookie
      &lt;/IfModule&gt;
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>I set a CNAME entry for <code>static.example.com</code> with the record <code>www.example.com</code>.</p>
  
  <p>How can I ensure that either all files served from the subdomain, or any files with those extensions, don't set cookies?</p>