Index: openacs-4/packages/static-pages/tcl/static-pages-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-sc-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/static-pages/tcl/static-pages-sc-procs.tcl 12 Sep 2002 22:44:31 -0000 1.3 +++ openacs-4/packages/static-pages/tcl/static-pages-sc-procs.tcl 25 Mar 2004 12:07:21 -0000 1.4 @@ -33,5 +33,18 @@ } { db_1row sp_url "" - return "${url}" + if {[string match /www/* $url]} { + # strip the /www off since its in pageroot + return [ad_url][string range $url 4 end] + } else { + # find a package to match the url + if {[regexp {/packages/([^/]*)/www/(.*)} $url match key stub]} { + set base [lindex [site_node::get_children -element url -package_key $key -node_id [site_node::get_element -url / -element node_id]] 0] + if {![empty_string_p $base]} { + return "[ad_url]$base$stub" + } + } + } + + return $url }