Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomas-thackery/5713e06abd06198629635c871f8fc85a to your computer and use it in GitHub Desktop.
Save thomas-thackery/5713e06abd06198629635c871f8fc85a to your computer and use it in GitHub Desktop.
Pantheon redirect environment to custom domain
#Set the $base_url parameter if we are running on Pantheon:
if (defined('PANTHEON_ENVIRONMENT')) {
if (PANTHEON_ENVIRONMENT == 'dev') {
$domain = 'sandbox.mysite.com';
}
else if (PANTHEON_ENVIRONMENT == 'test') {
$domain = 'staging.mysite.com';
}
else if (PANTHEON_ENVIRONMENT == 'live') {
$domain = 'www.mysite.com';
}
else {
# Fallback value for multidev or other environments.
# This covers environment-sitename.pantheonsite.io domains
# that are generated per environment.
$domain = $SERVER_['HTTP_HOST'];
}
# This global variable determines the base for all URLs in Drupal.
$base_url = 'https://'. $domain;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment