Base URLS: once more with feeling

This time using the fix proposed at http://stackoverflow.com/a/16930896