support for substituting domain and path when redirecting