Skip to content

Commit

Permalink
update code snippet to include fallback to HTTP_HOST
Browse files Browse the repository at this point in the history
if `$_ENV['PANTHEON_ENVIRONMENT']` is unset (e.g. in non-Lando local development environments), using PANTHEON_HOSTNAME will fatal as undefined, so we still need a fallback here.
  • Loading branch information
jazzsequence committed Apr 30, 2024
1 parent e68b75d commit 11ebf42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/content/guides/multisite/03-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ Make sure [Terminus](/terminus) is installed and [authenticated](/terminus/insta
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false ); // Set this to TRUE for Subdomain installs.
define( 'DOMAIN_CURRENT_SITE', PANTHEON_HOSTNAME );
// Use PANTHEON_HOSTNAME if in a Pantheon environment, otherwise use HTTP_HOST.
define( 'DOMAIN_CURRENT_SITE', defined( 'PANTHEON_HOSTNAME' ) ? PANTHEON_HOSTNAME : $_SERVER['HTTP_HOST'] );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Expand Down Expand Up @@ -122,7 +123,8 @@ Complete the steps below after spinning up a new WPMS site from the correct Cust
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false ); // Set this to TRUE for Subdomains
define( 'DOMAIN_CURRENT_SITE', PANTHEON_HOSTNAME );
// Use PANTHEON_HOSTNAME if in a Pantheon environment, otherwise use HTTP_HOST.
define( 'DOMAIN_CURRENT_SITE', defined( 'PANTHEON_HOSTNAME' ) ? PANTHEON_HOSTNAME : $_SERVER['HTTP_HOST'] );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Expand Down

0 comments on commit 11ebf42

Please sign in to comment.