Skip to content

Instantly share code, notes, and snippets.

@chucktrukk
Created February 5, 2013 21:21
Show Gist options
  • Save chucktrukk/4717766 to your computer and use it in GitHub Desktop.
Save chucktrukk/4717766 to your computer and use it in GitHub Desktop.
<?php
$urls_to_redirect = array(
'example-page',
'another-page',
'one-domain/a-page.html',
);
$current_url = $_SERVER['REQUEST_URI'];
if( isset($urls_to_redirect[$current_url]) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $modx->makeUrl($modx->config['error_page']) );
exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment