--- loncom/lontrans.pm 2018/04/21 20:34:44 1.22 +++ loncom/lontrans.pm 2018/05/08 15:31:22 1.23 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.22 2018/04/21 20:34:44 raeburn Exp $ +# $Id: lontrans.pm,v 1.23 2018/05/08 15:31:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -91,7 +91,10 @@ sub handler { } } my $host = $r->headers_in->get('Host'); - if ($host) { + if ($r->is_initial_req() || !$host) { + $r->internal_redirect($realuri); + return OK; + } else { my $protocol = 'http'; if ($r->get_server_port == 443) { $protocol = 'https';