Search code examples
htmlcsshttp-headersfavicon

add favicon with htaccess to a subdomain


Without explicitly declaring <link rel="shortcut icon" href="favicon.ico"> in the head of my document, can I add a favicon to every page within a particular subdirectory? I thought I read once that it can be done by adding a one-line htaccess file to the directory which I want to display the facicon, but now I can't seem to find that documentation.

Thanks!


Solution

  • If no favicon is defined, generally the browser will query the root of the domain.

    Ie. it will try www.example.com/favicon.ico

    If you put the file there it will apply to the whole domain.