Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -N -r1.140.2.79 -r1.140.2.80 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 28 Jun 2017 21:13:23 -0000 1.140.2.79 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 30 Jun 2017 12:21:25 -0000 1.140.2.80 @@ -2815,7 +2815,23 @@ } { set path [ad_conn url] - set lastchar [string index $path end] + # + # Check, if we are in a subsite + # + util::split_location [util_current_location] current_proto current_host current_port + set host_node_id [ad_get_node_id_from_host_node_map $current_host] + if {$host_node_id > 0} { + # + # yes, we are. strip the subsite-prefix from the location + # + set site_node_path [site_node::get_url -node_id $host_node_id] + if {[string length $path] > [string length $site_node_path]} { + set path [string range $path [string length $site_node_path]-1 end] + ns_log notice "util_current_directory reduced path <$path>" + } + } + + set lastchar [string index $path end]/ if {$lastchar eq "/" } { return $path } else {