rework getURL code to debug

trying to make it more tolerant of different slash-ending/slash-starting
styles to avoid trivial errors