#mynavi() #setlinebreak(on); #contents * 経緯 [#l056f4e2] #html(<div style="padding-left:10px">) 運用中のCakePHPで構築されたサイトに以下のエラーログが吐かれていた。 #myterm2(){{ YYYY-MM-DD 15:31:28 Error: [MissingControllerException] Controller class Apple-touch-icon.pngController could not be found. Exception Attributes: array ( 'class' => 'Apple-touch-icon.pngController', 'plugin' => NULL, ) Request URL: /apple-touch-icon.png Stack Trace: #0 /path_to/app/webroot/index.php(113): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse)) #1 {main} }} これは iPhone、iPad 用のアイコンをダウンロードしようとしているリクエストなのだが、 どうも対応が入っていなかった模様・・なので忘れないようにメモ。 #html(</div>) * 対応内容 [#d714cb49] #html(<div style="padding-left:10px">) 少し検索して出てくるような対応は既に行われていた。 ** app/View/Layouts/default.ctp [#q427721b] #html(<div style="padding-left:10px">) #mycode2(){{ <link rel="apple-touch-icon" sizes="180x180" href="<?= CONTEXT_ROOT ?>img/favicon.png"> <link rel="apple-touch-icon" sizes="180x180" href="/img/favicon.png"> }} #html(</div>) でも実際に apple-touch-icon.png とか apple-touch-icon-120x120.png へのリクエストは飛んできている。 なので、少し強引だが mod_rewrite で無理やり飛ばす事にした。 ** .htaccess [#wb254c54] #html(<div style="padding-left:10px">) #mycode2(){{ RewriteEngine On RewriteRule ^apple-touch-icon.*\.png$ /img/favicon.png [R=301,L] }} #html(</div>) もうこれで許して・・ #html(</div>)