Search code examples
htmlfaviconserver

Why is my favicon not working on server but is working locally?


New to web dev. I have a favicon that works locally but doesn't want to behave on server. The following is my favicon tag in the head tag:

<link rel="icon" type="image/png" href="../favicon/microphone-icon-192783/microphone-icon-16-192783.ico"/>

Am I missing something for the server?


Solution

  • Just upload the favicon to your root directory and give it the name "favicon.ico". By putting it in your root directory, you'll have a default favicon for all the pages in your domain.

    Depending on the browser you use, you can add the following two lines into the head section of your pages.

    <link rel="icon" href="favicon.ico" type="image/x-icon"> 
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">