简体   繁体   中英

Favicon works on localhost but not on a server?

I'm currently trying to figure out why my favicon isn't showing up. It works fine on my localhost but when I go to upload it to Netlify, it doesn't show up.

My favicon

My website

I am using React and then deploying it to a Netlify server. Not sure if that has something to do with it. Here's what I put in my index.html file in the public folder.

<link rel=”icon” href=”%PUBLIC_URL%/favicon.ico”>

And like I've already mentioned, it does work and show up with my localhost:3000. Any ideas on what I might be doing wrong?

您应该删除这些额外的引号: <link rel="”icon”" href="”/favicon.ico”">

I had the same issue and how many suggested in the comments, the problem was indeed in cache. So you can mark this as the answer for the future readers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM