Craft looks for /templates/404 by default. What do you do if you have multiple sites?
1 Answer
I pondered this for a while, and then did this, which will direct us to specific entries (not templates, I don't want to create more of those):
{# We need a unique 404 for each site - just take us to the
right slug relative to current URL #}
{% switch currentSite.id %}
{# siteA.com #}
{% case 1 %}
{% redirect '/my-404-slug' %}
{# siteB.com #}
{% case 2 %}
{% redirect '/my-other-404-slug' %}
{% endswitch %}
If you want to use templates instead of entries, just use an {% include %} statement instead of {% redirect %}.
-
1If you're happy with your solution don't forget to accept your answer.– neeksterCommented Dec 4, 2019 at 2:01