How to hide header and footer from 404 page? I create a 404 page on D7 site ( ie. mysite.com/404), which is a Basic Page. I am trying to hide the header and footer from this page. The header and footer are blocks, and they are placed in every page using Context. I tried tweaking the Context so that if Path = 404, hide the header and footer. 

It works when I go to mysite.com/404. However I try to hit an alias that doesn't exist (ie. mysite.com/asdf), instead of redirecting to /404, Drupal pulls the node body of the 404 page and stay at /asdf. The rule in the Context therefore doesn't apply. 

I don't want to use the Visibility control in the Block module because migrating the configuration between sites can be troublesome. How would you go about it?
I do this by overriding the template used by the theme. In the template.php:

/**
 * Set path to page-error.tpl if http error is returned.
 */
function yourtheme_preprocess_page(&amp;$vars) {
  // Set custom error template:
  $http_status = drupal_get_http_header("status");

  if (isset($http_status)) {

    switch ($http_status) {
      case "403 Forbidden":
      case "404 Not Found":
      case "500 Internal Server Error":
        $vars['theme_hook_suggestions'][] = 'page__error';
        $vars['http_status'] = "Error: " . $http_status;
        $vars['error_message'] = drupal_get_messages();
        break;
    }
  }
}


Then you can create page--error.tpl.php in your templates directory using whatever regions you want to display. This has added the benefit of automating error pages, so you don't have to set a path in the site config.