title: .htaccess in subdirectory of default apache2 directory
body: <p>I have apache2 installed and running on my computer, and I have a folder in </p>
  
  <pre><code>/var/www/html/my-site 
  </code></pre>
  
  <p>That I want to enable</p>
  
  <pre><code>Header set Access-Control-Allow-Origin "*"
  </code></pre>
  
  <p>So far I put a .htaccess file in the my-site folder, with</p>
  
  <pre><code>&lt;IfModule mod_headers.c&gt;
      Header set Access-Control-Allow-Origin "*"                  
      Header set Access-Control-Allow-Credentials true
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>But I'm a little unsure where to enable .htaccess for the directory. I made sure the apache2 header module is loaded, and I put a new directory listing in my apache2.conf file as such (unsure if that will work?), which still does not make it work:</p>
  
  <pre><code>&lt;Directory /var/www/html/my-site&gt;
          Options Indexes FollowSymLinks
          AllowOverride All
          Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>I don't want to mess around with adding a new site and possibly doing reverse proxy, so I just wanted to be able to make this site work. Is it possible, and am I doing something wrong here?</p>
  
  <p>Finally, I'm trying to use the javascript lib axios and run a request cross domain, but I get the error which is the reason why I'm doing this:</p>
  
  <pre><code>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sitethatisdesired.com. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)
  </code></pre>