Created
January 19, 2020 04:45
-
-
Save GABeech/006ac8150cb2ea096e4f935e7754bceb to your computer and use it in GitHub Desktop.
Don't Redirect aws health checks
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
function filterHealthChecks($redirect_url, $request_url) { | |
$localIp = getHostByName(getHostName()); | |
error_log($redirect_url); | |
error_log($request_url); | |
if(preg_match("http[s]?://{$localIp}/")) { | |
error_log("Matched"); | |
return false; | |
} | |
return true; | |
} | |
add_filter('redirect_canonical',1,2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment