fix 404 header status

This commit is contained in:
Peter Molnar 2013-11-07 10:06:49 +00:00
parent 7b2d91b025
commit 3f175aab95

View file

@ -116,8 +116,8 @@ foreach ( $wp_ffpc_keys as $internal => $key ) {
/* serve cache 404 status */ /* serve cache 404 status */
if ( isset( $wp_ffpc_values['meta']['status'] ) && $wp_ffpc_values['meta']['status'] == 404 ) { if ( isset( $wp_ffpc_values['meta']['status'] ) && $wp_ffpc_values['meta']['status'] == 404 ) {
header("HTTP/1.1 404 Not Found"); header("HTTP/1.1 404 Not Found");
flush(); // flush();
die(); // die();
} }
/* server redirect cache */ /* server redirect cache */
@ -253,13 +253,8 @@ function wp_ffpc_callback( $buffer ) {
} }
} }
if ( is_404() ) { if ( is_404() )
$meta['status'] = 404; $meta['status'] = 404;
header("HTTP/1.1 404 Not Found");
flush();
die();
}
/* redirect page */ /* redirect page */
if ( $wp_ffpc_redirect != null) if ( $wp_ffpc_redirect != null)
@ -309,8 +304,13 @@ function wp_ffpc_callback( $buffer ) {
$wp_ffpc_backend->set ( $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] ) , $meta ); $wp_ffpc_backend->set ( $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] ) , $meta );
$wp_ffpc_backend->set ( $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] ) , $buffer ); $wp_ffpc_backend->set ( $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] ) , $buffer );
/* vital for nginx, make no problem at other places */ if ( $meta['status'] == 404 ) {
header("HTTP/1.1 200 OK"); header("HTTP/1.1 404 Not Found");
}
else {
/* vital for nginx, make no problem at other places */
header("HTTP/1.1 200 OK");
}
/* echoes HTML out */ /* echoes HTML out */
return $buffer; return $buffer;