Better handling of resource URLs