Created
June 27, 2019 20:34
-
-
Save jasonlancaster/308c22da4e0129fb5749a86623c2824f to your computer and use it in GitHub Desktop.
Redirect all prod Drupal access to dev or alt environment
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
// Redirect user/admin pages to dev site while we are in active dev | |
/* | |
if (( | |
$_ENV['PANTHEON_ENVIRONMENT'] === 'live' || | |
$_ENV['PANTHEON_ENVIRONMENT'] === 'test' | |
) && ( | |
(strpos($_SERVER['REQUEST_URI'], '/user') !== false) || | |
(strpos($_SERVER['REQUEST_URI'], '/admin') !== false) | |
)) { | |
echo 'https://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
header('HTTP/1.0 301 Moved Permanently'); | |
header('Location: https://dev-cua.pantheonsite.io/'); | |
if (extension_loaded('newrelic')) { | |
newrelic_name_transaction("redirect"); | |
} | |
exit(); | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment