Skip to content

Instantly share code, notes, and snippets.

@holyPickleNick
Created February 23, 2016 16:49
Show Gist options
  • Save holyPickleNick/f473a6a645aa54ede869 to your computer and use it in GitHub Desktop.
Save holyPickleNick/f473a6a645aa54ede869 to your computer and use it in GitHub Desktop.
Pantheon Redirect Function
$redirects = array(
'/old_url/' => '/new_url/',
'/old_url/' => '/new_url/',
);
if (array_key_exists($_SERVER['REQUEST_URI'], $redirects)) {
header('HTTP/1.0 301 Moved Permanently');
header('Location: ' . $redirects[$_SERVER['REQUEST_URI']]);
exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment