Sometimes when I want to write custom routing code, I use the 404 partial. This is because if I have links that would normally 404, but I need them to do something different, like display a webapp or category index, the 404 partial is a great place for me to add custom ELSE logic as all those edge cases end up there.
I would normally add {% response_status 200 %} if my custom logic succeeds in displaying a view.
However, I notice that you set the response status to 404 AFTER including the 404 partial on webapp and cateogry detail pages. Please could you switch it round so that the response status is set first so that I can have the option of overwriting it?
I think it would work if we changed:
{%- include '404' -%}
{%- response_status 404 -%}
to
{%- response_status 404 -%}
{%- include '404' -%}
I have now tested it, and swapping the order of those two lines works great. The partial is able to use its response status to overwrite the pages' response_status. The last one to be set "wins".
Created by Colin Greenway