This is a method to ensure the domain part of a URI can be contextually served based on the domain the client loads your WordPress site on (ideal for reverse proxies or staging sites).
Add this to your wp-config.php:
$domaincheck = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (strpos($domaincheck,'https://403.ie') !== false) {
define( 'WP_HOME', 'https://403.ie' );
define( 'WP_SITEURL', 'https://403.ie') ;
} else {
define( 'WP_HOME', 'https://staging.403page.com' );
define( 'WP_SITEURL', 'https://staging.403page.com') ;
}
Add this to your wp-config.php:
$domaincheck = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (strpos($domaincheck,'https://403.ie') !== false) {
define( 'WP_HOME', 'https://403.ie' );
define( 'WP_SITEURL', 'https://403.ie') ;
} else {
define( 'WP_HOME', 'https://' . $_SERVER['SERVER_NAME'] );
define( 'WP_SITEURL', 'https://' . $_SERVER['SERVER_NAME'] ) ;
}
Add this to your wp-config.php:
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
Add this to your wp-config.php:
if ( ! empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
$_SERVER['HTTP_HOST'] = '403page.com';}
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);