ENH: some URL rewriting fixes and additions