--- loncom/lonencurl.pm 2011/10/01 03:18:57 1.5 +++ loncom/lonencurl.pm 2016/02/22 03:36:57 1.6 @@ -2,7 +2,7 @@ # The LearningOnline Network # URL translation for encrypted filenames # -# $Id: lonencurl.pm,v 1.5 2011/10/01 03:18:57 raeburn Exp $ +# $Id: lonencurl.pm,v 1.6 2016/02/22 03:36:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -76,11 +76,16 @@ sub handler { } } } + my $anchor; if ($redirect eq '') { $redirect=&Apache::lonenc::unencrypted($r->uri); + if ($redirect =~ m{^/adm/wrapper/ext/[^\#]+(\#.+)$}) { + $anchor = $1; + $redirect =~ s/\#.+$//; + } } if ($r->args) { $redirect.='?'.$r->args; } - $r->internal_redirect($redirect); + $r->internal_redirect($redirect.$anchor); return OK; } return FORBIDDEN;