I use this PHP code on an apache server and it works fine:
$actual_link = "http" . (($_SERVER['SERVER_PORT']==443) ? "s://" : "://") . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
Now my question is if this would equally work on an IIS server. I’ve read that there are differences between them when using PHP so I would just like to be sure.
Thanks for your feedback :).
Don’t use
$_SERVER['SERVER_PORT']==443. Instead check if$_SERVER['HTTPS']equals ‘on’.