Created
July 3, 2014 18:42
-
-
Save kyuumeitai/944b96d21ebe95905846 to your computer and use it in GitHub Desktop.
hack 404
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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