Categories
Blogs Free Open Source Software (FOSS) Free to use Wordpress

Tidak bisa melihat IP Public yang memberi komentar atau pengunjung

Hal tersebut biasanya terjadi apabila wordpress anda, atau web servernya berada dibelakang sebuah firewall dan hanya memiliki IP Local (tidak memiliki IP Public), sehingga setiap pengunjung akan melewati firewall, dan IP Local firewall lah yang terdeteksi oleh WordPress.

Untuk mengetahui IP Public pengunjung maka di perlukan X-Forwarded-For HTTP, bisa dilihat di https://gist.github.com/ryanjbonnell/9509696

Tambahkan ini di wp-config wordpress:

// Use X-Forwarded-For HTTP Header to Get Visitor’s Real IP Address

if ( isset( $_SERVER[‘HTTP_X_FORWARDED_FOR’] ) ) {
$http_x_headers = explode( ‘,’, $_SERVER[‘HTTP_X_FORWARDED_FOR’] );

$_SERVER[‘REMOTE_ADDR’] = $http_x_headers[0];
}

Jika ingin mudah, tanpa manual insert code, pergunakan saja plugin https://id.wordpress.org/plugins/loginizer/

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from Just Shared on Tel-U

Subscribe now to keep reading and get access to the full archive.

Continue reading