better handling on root url
with domain in output filename