Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Favicon shows up on rails local, not on hosted app

I put my favicon.ico in my public folder, and it shows up on my localhost, but when I check it out on the internet, other favicon shows up instead. My app is hosted through heroku, and the domain is provided by hover. Where is this failing?

Also, in case this helps, here is the code I'm using to render the favicon:

<!DOCTYPE html>
<html>
  <head>
    <link rel="shortcut icon" href="/favicon.ico" />
    <title>Shoulak Predictions</title>
    <%= stylesheet_link_tag    'application', media: 'all' %>
    <%= javascript_include_tag 'application' %>
    <%= csrf_meta_tags %>
    <%= render 'layouts/shim' %>    
  </head>
  <body>
    <%= render 'layouts/header' %>
    <div class="container">
      <% flash.each do |key, value| %>
        <div class="alert alert-<%= key %>"><%= value %></div>
      <% end %>
      <%= yield %>
    </div>
    <div class="container">
        <%= render 'layouts/footer' %>
        <%= debug(params) if Rails.env.development? %>
    </div>
  </body>
</html>

Update

If I go to mydomain.com/favicon.ico, I do download the favicon that I uploaded. ALSO, if I go to therealapp.herokuapps.com, it shows up. I think somehow my domain provider may be providing their own?

like image 492
JShoe Avatar asked Dec 21 '22 08:12

JShoe


1 Answers

Adding a random number in your favicon will force the update:

<link rel="shortcut icon" href="/favicon.ico?v=2" />
like image 101
Vassilis Avatar answered Jan 06 '23 17:01

Vassilis