我该如何在Symfony动作中重定向到外部URL?
我尝试了以下选项:
1- return $this->redirect("www.example.com");
错误:未找到“GET /www.example.com”的路由
2- $this->redirect("www.example.com");
错误: 控制器必须返回一个响应(null given)。
3- $response = new Response();
$response->headers->set("Location","www.example.com");
return $response
没有错误,但页面是空白的!