I would like my favicon.ico to be accessible by http://example.com/favicon.ico and http://example.com/apple-touch-icon.png, but I can't manage that. I tried few things, but nothing helped. My favicon.ico/apple-touch-icon.png is located in the theme root folder.

How can I achieve this?

4 Answers 4


use a symlink, I typically keep my main favicon in my root theme folder, and then in the terminal navigate to the site root and symlink to that icon

ln -s PATH/TO/THEME/favicon.ico

it makes the most sense to me to keep my theme assets in my theme directory, but then I also like to have the same favicon accessible from the doc-root as well


Use Sumit Madan's answer for favicon.

You can put the touch-icon in the files folder too. And edit yourtheme's template.php

Put this:

  $appleIcon = array('#tag' => 'link', '#attributes' => array('href' => '/sites/default/files/apple-touch-icon-144x144.png', 'rel' => 'apple-touch-icon', 'type' => 'image/png'),);
  drupal_add_html_head($appleIcon, 'apple-touch-icon');


function yourtheme_preprocess_html(&$variables) {


I would personally just do a .htaccess Rewrite rule:

RewriteCond %{REQUEST_URI} /favicon.ico
RewriteRule ^ /actual/path/to/favicon.ico

and same for apple touch icon


Just place your image in root folder and add the path as in screenshot :

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.