Execute function based on request url