--- old/wp-blog-header.php	2005-07-19 11:31:25.000000000 +0200
+++ new/wp-blog-header.php	2005-07-19 11:31:16.000000000 +0200
@@ -190,11 +190,19 @@
 if ( (0 == count($posts)) && !is_404() && !is_search()
 		&& ( isset($rewrite) || (!empty($_SERVER['QUERY_STRING']) &&
 		(false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
-	$wp_query->is_404 = true;
-	if ( preg_match('/cgi/', php_sapi_name()) )
-		@header('Status: 404 Not Found');
-	else
-		@header('HTTP/1.x 404 Not Found');
+	if (apply_filters('is_403', false)) {
+		$wp_query->is_403 = true;
+		if ( preg_match('/cgi/', php_sapi_name()) )
+			@header('Status: 403 Access Forbidden');
+		else
+			@header('HTTP/1.x 403 Access Forbidden');
+	} else {
+		$wp_query->is_404 = true;
+		if ( preg_match('/cgi/', php_sapi_name()) )
+			@header('Status: 404 Not Found');
+		else
+			@header('HTTP/1.x 404 Not Found');
+	}
 }
 
 if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
@@ -211,6 +219,9 @@
 	} else if ( is_trackback() && empty($doing_trackback) ) {
 		include(ABSPATH . '/wp-trackback.php');
 		exit;
+	} else if ( is_403() && get_403_template() ) {
+		include(get_403_template());
+		exit;
 	} else if ( is_404() && get_404_template() ) {
 		include(get_404_template());
 		exit;

