This is my first Craft site, I inherited it. I've manually set a link tag to my favicon in my templates/_layouts/_header.twig file:

Everything else in that /dist/img folder renders fine - .png, .jpg, .gif. Everything inside the other /dist subdirs renders fine - /css, /js, /pdf... What am I missing? Going directly to the favicon.ico url, I get a blank page with this:

"Unable to find the template “_layoutâ€."

I do not understand the routing - but that feels like a red herring here anyway. I don't have any routes set up in the cms, and everything else in the /dist directory renders fine when I link directly to it. Thanks for any ideas.


1 Answer 1


I don't think you can open a .ico file with the browser directly, that's why the request 404s.

There's two ways to make it do its thing:

  • simply place it in the web root, e.g. public/favicon.ico

  • use this link tag in your document head: <link rel="icon" href="{{ url('dist/img/favicon.ico') }}" type="image/x-icon">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.