Dynamically determine base URL.