title: Apache Rewrite: favicon in %{HTTP_HOST} directory
body: <p>My software supports multiple domains pointed at the exact same directory, I use shared hosting. I need to have each domain's favicon load from directories with their respective host names. Here is a visual...</p>
  
  <pre><code>http://www.example1.com/favicon.ico
  public_html/www.example1.com/favicon.ico
  </code></pre>
  
  <p>\</p>
  
  <pre><code>http://www.example2.com/favicon.ico
  public_html/www.example2.com/favicon.ico
  </code></pre>
  
  <p>\</p>
  
  <pre><code>http://www.example3.com/favicon.ico 
  public_html/www.example3.com/favicon.ico
  </code></pre>
  
  <p>I've tried some rewrites along the lines like this without any success...</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^favicon\.ico$ %{HTTP_HOST}/favicon\.ico
  </code></pre>
  
  <p>Things to keep in mind...</p>
  
  <p>1.) I use shared hosting so remember that the answer I need should be short and simple.</p>
  
  <p>2.) I will only accept a DYNAMIC answer, I will only use the %{HTTP_HOST} variable and NOT a static domain name as I will not be manually editing my .htaccess file every single time I add a domain name.</p>
  
  <p>3.) I may end up putting a .htaccess file in those sub-directories though I do not at the moment, an exception for the favicon would be greatly appreciated though is not necessary for me to accept the answer.</p>
  
  <p>4.) I'll be more than happy to make any clarifications.</p>