Created
September 14, 2018 02:28
-
-
Save thomas-thackery/5713e06abd06198629635c871f8fc85a to your computer and use it in GitHub Desktop.
Pantheon redirect environment to custom domain
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
#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