switch return and cacel url given the request url