Skip to content

Instantly share code, notes, and snippets.

@GABeech
Created January 19, 2020 04:45
Show Gist options
  • Save GABeech/006ac8150cb2ea096e4f935e7754bceb to your computer and use it in GitHub Desktop.
Save GABeech/006ac8150cb2ea096e4f935e7754bceb to your computer and use it in GitHub Desktop.
Don't Redirect aws health checks
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