First go at trying to use a dynamic base URL - to be continued