Search code examples
htmlhreffaviconico

Problems with favicon, can not make it to show up whenever the path is different than having it saved in the same folder as the html one


<link rel="icon" type="image/x-icon" href="/photos/icon.ico" /> so this does not work

<link rel="icon" type="image/x-icon" href="icon.ico"> but this works having the favicon in the same folder as the html one. How do I make it so that it will show up having it saved in the photos folder?


Solution

  • its a path problem. you can try one of two things.

    1. if on a live server already, you can direct it to where the file is located as this href="https://www.example.com/photos/icon.ico" (remember to path correctly if your photos folder isnt located in public_html)

    2. if the resource is located on a local server you can try using "./" (same folder as current page) or "../"(previous folder from current page).