Created
February 23, 2016 16:49
-
-
Save holyPickleNick/f473a6a645aa54ede869 to your computer and use it in GitHub Desktop.
Pantheon Redirect Function
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
$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