Last active
April 8, 2018 02:47
-
-
Save VaLeXaR/72886e5353e4a2daebae36b6a57dcd23 to your computer and use it in GitHub Desktop.
Fix http host port for Wordpress #tags: WordPress
This file contains 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
<?php | |
add_action('init', function () { | |
if(!empty($_SERVER['HTTP_HOST']) && substr($_SERVER['HTTP_HOST'],-3)==':80') | |
$_SERVER['HTTP_HOST'] = substr($_SERVER['HTTP_HOST'],0,-3); | |
if(!empty($_SERVER['HTTP_X_FORWARDED_HOST']) && substr($_SERVER['HTTP_X_FORWARDED_HOST'],-3)==':80') | |
$_SERVER['HTTP_X_FORWARDED_HOST'] = substr($_SERVER['HTTP_X_FORWARDED_HOST'],0,-3); | |
}, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment