diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb
index a74f93bafe9..0843f71338c 100644
--- a/app/views/layouts/_head.html.erb
+++ b/app/views/layouts/_head.html.erb
@@ -1,13 +1,14 @@
-
+<%- if SiteSetting.favicon_url.present? %>
+<%- end %>
+<%- if SiteSetting.apple_touch_icon_url.present? %>
-<% if SiteSetting.apple_touch_icon_url != "/images/default-apple-touch-icon.png" %>
+<%- end %>
+<%- if (SiteSetting.apple_touch_icon_url != "/images/default-apple-touch-icon.png") && SiteSetting.apple_touch_icon_url.present? %>
-<% end %>
+<%- end %>
-
-
<%= canonical_link_tag %>