Skip to content

Instantly share code, notes, and snippets.

@Tmeister
Created August 12, 2021 14:35
Show Gist options
  • Save Tmeister/3dd901b8c47f5fe041c6531c1306d442 to your computer and use it in GitHub Desktop.
Save Tmeister/3dd901b8c47f5fe041c6531c1306d442 to your computer and use it in GitHub Desktop.
WordPress response to different domains
<?php
if(isset($_SERVER['HTTP_HOST'])){
define('CUSTOM_REQUEST_URL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', CUSTOM_REQUEST_URL);
define('WP_HOME', CUSTOM_REQUEST_URL);
}
/* That's all, stop editing! Happy publishing. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment