tedshd's DevNote

Develop & Design Note by Ted

PHP - check HTTP protocol

PHP - check HTTP protocol

Use

$protocol    = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'https' : 'http';
comments powered by Disqus