--- loncom/auth/switchserver.pm 2021/01/03 23:53:15 1.53 +++ loncom/auth/switchserver.pm 2021/05/03 15:27:43 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network # Switch Servers Handler # -# $Id: switchserver.pm,v 1.53 2021/01/03 23:53:15 raeburn Exp $ +# $Id: switchserver.pm,v 1.54 2021/05/03 15:27:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -123,6 +123,10 @@ sub handler { if ($Apache::lonnet::protocol{$env{'form.otherserver'}} eq 'https') { $protocol = $Apache::lonnet::protocol{$env{'form.otherserver'}}; } + unless ($env{'form.otherserver'} eq $r->dir_config('lonHostID')) { + my $alias = &Apache::lonnet::use_proxy_alias($r,$env{'form.otherserver'}); + $switch_to = $alias if ($alias ne ''); + } } if ($env{'user.name'} eq 'public'