プラットフォーム別の favicon
アイコンファイル自体はどこでも同じですが、置き場所は異なります。自分のスタックを選び、その慣習に合わせて書かれたガイドに従ってください。全部で 19 本あり、実際のファイルパスと設定が載っています。
フレームワーク
Next.js はアイコンを、手書きの link タグではなくファイルから解決します。正しいファイル名を正しいディレクトリに置けば、フレームワークが代わりにマークアップを出力します。
ガイドを見るReact はドキュメントの head に一切手を触れません。アイコンの link は HTML のシェルに置くことになり、それがどのファイルかは、プロジェクトを Create React App と Vite のどちらで生成したかによって決まります。
ガイドを見るVue の単一ファイルコンポーネントは、head に link タグをレンダリングできません。アイコンは index.html で宣言し、そのファイルは Vite ではプロジェクトルートに、Vue CLI では public/ の中にあります。
ガイドを見るAngular は、ビルド設定がそう指示した場合にのみ静的ファイルをコピーします。angular.json の assets エントリーにマッチしないファイルは、プロジェクトのどこに置いても dist/ には届きません。
ガイドを見るSvelteKit は static/ の中身をすべてビルドのルートへコピーし、ドキュメントのシェルはコンポーネントではなく src/app.html です。アイコンのタグはそこに置くことで、JavaScript が動く前の、配信される HTML に含まれます。
ガイドを見るNuxt はデフォルトで、すべてのページに /favicon.ico への link を挿入します。そのため新規プロジェクトは、public/ にファイルを置くまでその 404 を記録します。残りのアイコンは nuxt.config の app.head ブロックで宣言します。
ガイドを見るVite は珍しく、index.html を静的アセットではなくソースコードとして扱います。ファイルはプロジェクトルートにあり、ビルド時に書き換えられます。public/ の中身はすべて、手を加えられずに出力ルートへコピーされます。
ガイドを見るRemix (and React Router framework mode, which is the same route API under renamed packages) does not pick up icons from a special filename. You put files in public/ and return them from the root route's links() export so <Links /> can render them into the document head.
ガイドを見るLaravel has no icon convention of its own. Files in public/ are served at the site root, and the link tags belong in your Blade layout's head. Getting the web server's document root wrong is the most common reason a perfectly placed favicon.ico still 404s.
ガイドを見るDjango does not special-case favicons. Icons are ordinary static files collected into STATIC_ROOT and referenced from your base template with the static template tag. In production the collectstatic step is what makes them reachable.
ガイドを見るRails expects the favicon to go through the asset pipeline. Put the files under app/assets/images and declare them with favicon_link_tag in the application layout so production fingerprinting keeps working.
ガイドを見るIn ASP.NET Core the web root is wwwroot. Icon files go there, and the link tags go in your layout (MVC/Razor Pages) or App component (Blazor). Static file middleware has to be in the pipeline or every icon 404s regardless of the markup.
ガイドを見る静的サイト
CMS
Eコマース
ノーコード
Squarespace はファビコンを browser icon と呼び、それはサイト設定でアップロードする 1 枚の正方形画像です。ファイルシステムも、編集できるテンプレートもないため、その 1 回のアップロードで得られるものがほぼすべてです。
ガイドを見る