title: Enable favicon on Apache 2.4 with SSL
body: <p>I have Django app and can serve favicon via it. But it is not recommended so I did it using Apache.</p>
  
  <p>Previously I had HTTP 80 configs. After moving from HTTP to SSL 443 I cannot access the favicon on the server anymore.</p>
  
  <p>The part of responsible config looks like:</p>
  
  <pre><code>&lt;VirtualHost *:443&gt;
  
          DocumentRoot /home/ubuntu/project/project/
  
          Alias /favicon.ico /home/ubuntu/project/static/favicon.ico
          Alias /static/ /home/ubuntu/project/static/
  
          &lt;Location /&gt;
             Require host mysite.com
          &lt;/Location&gt;
  
          &lt;Directory /home/ubuntu/project/static&gt;
              Require all granted
          &lt;/Directory&gt;
      &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Folder exists and favicon is located in it. </p>
  
  <p>When I am trying to access favicon.ico I get 403:</p>
  
  <pre><code>Forbidden
  You don't have permission to access /favicon.ico on this server.
  </code></pre>
  
  <p>How can I solve it?</p>
  
  <p><strong>Updates:</strong></p>
  
  <ol>
  <li><p>I have found <a href="https://serverfault.com/questions/377186/apache-namevirtualhost-on-port-443-ignores-serveralias">here</a> that ServerAliases are ignored with SSL, so probably Aliases are ignored as well. </p></li>
  <li><p><a href="http://staticfiles.productiondjango.com/blog/failproof-favicons/" rel="nofollow noreferrer">Here</a> is good overview How to serve favicons with Django, but I want to do it only with Apache to minimize the number of requests to Django.</p></li>
  <li><p><a href="https://askubuntu.com/questions/873851/enable-favicon-on-apache-2-with-ssl">Here</a> some developers suggested me to check favicon permissions but it didn't help.</p></li>
  <li><p>The problem is in the root <strong>location</strong> directive which restricts access to the whole website. If somebody knows how to make exception just for favicon please post it in answer!</p></li>
  </ol>