Fix the issue on multiple baseurls

1. Fix the issue on multiple baseurls #13, and partially for #9
1. Support mixed baseurls (s3 urls and non-s3 urls)