Dynamically determine the base URL.