fix 404 header status
This commit is contained in:
parent
7b2d91b025
commit
3f175aab95
1 changed files with 10 additions and 10 deletions
|
@ -116,8 +116,8 @@ foreach ( $wp_ffpc_keys as $internal => $key ) {
|
|||
/* serve cache 404 status */
|
||||
if ( isset( $wp_ffpc_values['meta']['status'] ) && $wp_ffpc_values['meta']['status'] == 404 ) {
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
flush();
|
||||
die();
|
||||
// flush();
|
||||
// die();
|
||||
}
|
||||
|
||||
/* server redirect cache */
|
||||
|
@ -253,13 +253,8 @@ function wp_ffpc_callback( $buffer ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( is_404() ) {
|
||||
if ( is_404() )
|
||||
$meta['status'] = 404;
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
flush();
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
/* redirect page */
|
||||
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_data'] ) , $buffer );
|
||||
|
||||
/* vital for nginx, make no problem at other places */
|
||||
header("HTTP/1.1 200 OK");
|
||||
if ( $meta['status'] == 404 ) {
|
||||
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 */
|
||||
return $buffer;
|
||||
|
|
Loading…
Reference in a new issue