Apple touch icon in html head or htaccess file

I am creating a new web application.

I have badges for badges and apples, ready to go. I was wondering if I need to include them in the "head" of my HTML file, or is their routing from the file .htaccessacceptable?

HTML code:

<head>
  <link rel="shortcut icon" href="assets/ico/favicon.ico">
  <!-- Standard iPhone --> 
  <link rel="apple-touch-icon" sizes="57x57" href="touch-icon-iphone-114.png" />
  <!-- Retina iPhone --> 
  <link rel="apple-touch-icon" sizes="114x114" href="touch-icon-iphone-114.png" />
  <!-- Standard iPad --> 
  <link rel="apple-touch-icon" sizes="72x72" href="touch-icon-ipad-144.png" />
  <!-- Retina iPad --> 
  <link rel="apple-touch-icon" sizes="144x144" href="touch-icon-ipad-144.png" />
</head>

or just put them in htaccess?

    # Rewrite for Favicons
RewriteRule ^favicon\.ico$ assets/ico/favicon.ico [L]
RewriteRule ^apple-touch-icon\.png$ assets/ico/apple-touch-icon.png [L]
RewriteRule ^apple-touch-icon-57x57\.png$ assets/ico/apple-touch-114-icon.png [L]
RewriteRule ^apple-touch-icon-114x114\.png$ assets/ico/apple-touch-icon-114.png [L]
RewriteRule ^apple-touch-icon-72x72\.png$ assets/ico/apple-touch-icon-144.png [L]
RewriteRule ^apple-touch-icon-144x144\.png$ assets/ico/apple-touch-icon-144.png [L]

Question: Is there any drawback to just putting them in my file .htaccessand removing them from my HTML?

+3
source share
2 answers

You do not need to specify them if you follow the Apple naming convention.

From the Apple documentation :

, - apple-touch-icon... apple-touch-icon-precomposed... prefix. , 57 x 57, :

  • - -57x57-precomposed.png
  • - -57x57.png
  • - -precomposed.png
  • - icon.png
+7

, :

RewriteRule ^apple-touch-icon\.png$ assets/ico/apple-touch-icon.png [L]
RewriteRule ^apple-touch-icon-[0-9].* assets/ico/apple-touch-114-icon.png [L]

, 114x114 iPhone? , , - 114x114 apple-touch-icon.png . , 114px , . - 404 apache, .

+3

All Articles