Answers for "wp varnish ip"

PHP
0

wp varnish ip

//Add at the top of wp-config.php

$temp_ip = explode(',', isset($_SERVER['HTTP_X_FORWARDED_FOR'])
? $_SERVER['HTTP_X_FORWARDED_FOR'] :
(isset($_SERVER['HTTP_CLIENT_IP']) ?
$_SERVER['HTTP_CLIENT_IP'] : $_SERVER['REMOTE_ADDR']));
$remote_addr = trim($temp_ip[0]);
$_SERVER['REMOTE_ADDR'] = preg_replace('/[^0-9.:]/', '', $remote_addr );
Posted by: Guest on May-18-2021

Browse Popular Code Answers by Language