Use PHP for http → https redirection

since HTTP_X_FORWARDED_PROTO is now supported
https://bugzilla.wikimedia.org/show_bug.cgi?id=53689