Rewrite custom server URL implementation to support multiple custom endpoints