How to get my custom 404/403 pages to work with Bootstrap? I use this in my template.php for custom error pages:

  //custom 404 not found page
  $header = drupal_get_http_header("status");
  if($header == "404 Not Found") {
    $vars['theme_hook_suggestions'][] = 'page__404';
    drupal_add_css('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', array('type' =&gt; 'external'));
  }

  //custom 403 access denied page
  $header = drupal_get_http_header("status");
  if($header == "403 Forbidden") {
    $vars['theme_hook_suggestions'][] = 'page__403';
    drupal_add_css('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', array('type' =&gt; 'external'));
  }


And I have custom page--403.tpl.php and page--404.tpl.php (these don't exist as nodes)

And they work if it's non-Bootstrap theme, e.g. it works on Zen theme, but it doesn't work on Bootstrap theme. When you go to some random URL it just gives the default page not found error and doesn't load my custom pages.

And I don't get it why.

Also with Bootstrap theme you have to put your custom pages inside templates/system and put your custom functions inside page.vars.php.
You're using $vars instead of $variables (per conversation in IRC).