Redirecting certain 404s to a page, handling all others as normal 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 ?
You could also set up a route for news/{slug} to point to your news template, and have it do the check to see if the entry in segment_2 is valid, and do something based on that.

I did something like this for my "members" pages:

 {% set thisProfile = craft.users.id(craft.request.segment(2))[0] %}

 {% if not thisProfile %}
    {% redirect siteUrl %}
 {% endif %}