Created
June 20, 2024 10:43
-
-
Save mgussekloo/c682716f9251f6cf44433362ba863c11 to your computer and use it in GitHub Desktop.
Revisions
-
mgussekloo created this gist
Jun 20, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ <?php // phpcs:ignoreFile define( 'EXPOSED_DOMAIN', 'xxx.sharedwithexpose.com' ); define( 'REAL_DOMAIN', 'mydomain.test' ); // Load only if we are running under Expose. if ( empty( $_SERVER['HTTP_X_ORIGINAL_HOST'] ) || strpos($_SERVER['HTTP_X_ORIGINAL_HOST'], EXPOSED_DOMAIN) === false) { return; } ob_start(function($buffer) { return str_replace(REAL_DOMAIN, EXPOSED_DOMAIN, $buffer); }); add_action('shutdown', function() { ob_end_flush(); });