Created
February 1, 2013 15:40
-
-
Save anonymous/4692062 to your computer and use it in GitHub Desktop.
410 status for pages intentionally removed
This file contains 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
/* ===== START 410 TERMINATED EMPLOYEE PAGES ====== */ | |
function terminatedEmployee410(){ | |
$terminatedEmployees = array('http://www.adviceinteractivegroup.com/jared-carrizales/','http://www.adviceinteractivegroup.com/katie-walsh/','http://www.adviceinteractivegroup.com/danell-goodwyn/','http://www.adviceinteractivegroup.com/allison-parkyn/','http://www.adviceinteractivegroup.com/lola-howle/','http://www.adviceinteractivegroup.com/haley-butler/'); | |
$req = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
$req = rawurldecode( $req ); | |
foreach( $terminatedEmployees as $terminatedEmployee ): | |
if( $terminatedEmployee === $req ): | |
status_header( 410 ); | |
if( !locate_template( '410.php', true ) ) | |
echo 'Sorry, the page you requested has been permanently removed.'; | |
exit(); | |
endif; | |
endforeach; | |
}//end terminatedEmployee410 | |
if( !is_admin() ) | |
add_action( 'template_redirect', 'terminatedEmployee410'); | |
/* ===== END 410 TERMINATED EMPLOYEE PAGES ====== */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment