$base_url =~ s!/[^/]*?$!!; #strip off the subdirectory