Intercept 404s for pages in certain path I have a site that regularly adds &amp; removes event nodes based on a third party system. When these nodes are removed, any other articles that link to them get 404 pages. Is there a way I could intercept the 404 results for pages with a certain path and redirect them to the event landing page instead?

I have tried adding the following to template.php but I get a redirect loop

function MYTHEME_preprocess_page(&amp;$vars)
{
    // Redirect expired events
    $status = drupal_get_http_header("status");
    if ($status == "404 Not Found" &amp;&amp; preg_match('/\/events\//', request_uri())) {
        drupal_set_message('Sorry, this event is no longer available','error');
        drupal_goto('/events/');
    }
}
Use the Match Redirect module to redirect specific pages that matches urls.

Summary of drupal project page :

This module provides redirecting based on path patterns with wildcards. This functions much like how block page visibility works. You specify a pattern like "old-blog/*" and a target like "new-blog" and all pages under old-blog will be redirected to the page new-blog.

Features
Pattern matching allowing wildcard redirects
Redirect code choice (301, 302, etc)
Filters out existing pages so they won't be redirected (unless overridden)
Loop protection (no chaining redirects allowed)