Skip to content

Instantly share code, notes, and snippets.

@kyuumeitai
Created July 3, 2014 18:42
Show Gist options
  • Save kyuumeitai/944b96d21ebe95905846 to your computer and use it in GitHub Desktop.
Save kyuumeitai/944b96d21ebe95905846 to your computer and use it in GitHub Desktop.
hack 404
add_filter('status_header', 'mnet_hack_404', 10);
function mnet_hack_404($c) {
if (defined('HACK_404')) {
$header = '200';
$text = get_status_header_desc($header);
$protocol = $_SERVER['SERVER_PROTOCOL'];
if ('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol)
$protocol = 'HTTP/1.0';
return "$protocol $header $text";
}
else {
return $c;
}
}
define('HACK_404', true);
require($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment