diff --git a/src/routes/favicon.ico/+server.ts b/src/routes/favicon.ico/+server.ts new file mode 100644 index 0000000..21bb3bd --- /dev/null +++ b/src/routes/favicon.ico/+server.ts @@ -0,0 +1,17 @@ +import type { RequestHandler } from '@sveltejs/kit'; + +/** + * Redirects /favicon.ico to /favicon/favicon.ico + * + * This handles browsers that request favicon.ico from the root + * and redirects them to the actual location in the /favicon/ directory. + */ +export const GET: RequestHandler = () => { + return new Response(null, { + status: 301, // Permanent redirect + headers: { + Location: '/favicon/favicon.ico', + 'Cache-Control': 'public, max-age=31536000, immutable' + } + }); +}; \ No newline at end of file