I'm having trouble setting things up to redirect some old news articles a certain way, while still serving existing articles:
If a page exists at
/news/my-article
then it should be served as normal.If that URL doesn't exist (ie, all non-functioning
/news/*
URLs), I want the user to be redirected to/news
.All 404s that aren't within
/news
should be handled as normal.
My first thought was to use a redirect
tag in the 404 template, only if the request URL matches /news/*
... but I'm not sure if that's too late in the process. By that time, has a 404 header already been sent, so the user would get 404 -> 301 -> 404 ?