# \#redirect

**URL:** https://forum.elixirforum.com/tag/redirect/1176.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [How to redirect a logged in user's route to another](https://forum.elixirforum.com/t/how-to-redirect-a-logged-in-users-route-to-another/56930)

<div class="topic-metadata">

**Author:** [@Samuei2000](https://forum.elixirforum.com/u/Samuei2000)\
**Replies:** 5\
**Last updated:** [February 8, 2024, 10:44pm UTC](https://forum.elixirforum.com/t/how-to-redirect-a-logged-in-users-route-to-another/56930 "2024-02-08T22:44:51Z")

</div>

The question is If a logged in user visits the / route, make them redirect to the /guess route. I have scope "/", PentoWeb do pipe\_through :browser get "/", PageController, :home end and scope "/", Pent…

---

## [Req: Accumulating redirects - is this the proper way to go about it?](https://forum.elixirforum.com/t/req-accumulating-redirects-is-this-the-proper-way-to-go-about-it/55218)

<div class="topic-metadata">

**Author:** [@scoop](https://forum.elixirforum.com/u/scoop)\
**Replies:** 2\
**Last updated:** [May 20, 2023, 1:56pm UTC](https://forum.elixirforum.com/t/req-accumulating-redirects-is-this-the-proper-way-to-go-about-it/55218 "2023-05-20T13:56:33Z")

</div>

Dear all, I threw together a custom step for req that accumulates the responses from the redirects that were followed. Basically, I re-implemented the follow\_redirects step from req and added accumulation which is then…

---

## [Redirect does not work](https://forum.elixirforum.com/t/redirect-does-not-work/39242)

<div class="topic-metadata">

**Author:** [@peter-de-boer](https://forum.elixirforum.com/u/peter-de-boer)\
**Replies:** 5\
**Last updated:** [November 29, 2022, 7:16am UTC](https://forum.elixirforum.com/t/redirect-does-not-work/39242 "2022-11-29T07:16:32Z")

</div>

I am trying to redirect to an external URL. In one of the handle\_info functions in my liveview, I have something like: redirect(socket, external: "https://somewebsite.com") But it just does not do anything. If I chan…

---

## [Phoenix and redirecting after POST](https://forum.elixirforum.com/t/phoenix-and-redirecting-after-post/31124)

<div class="topic-metadata">

**Author:** [@wolf4earth](https://forum.elixirforum.com/u/wolf4earth)\
**Replies:** 1\
**Last updated:** [May 25, 2021, 12:20am UTC](https://forum.elixirforum.com/t/phoenix-and-redirecting-after-post/31124 "2021-05-25T00:20:14Z")

</div>

When redirecting after a POST to the GET representation of the resource it’s recommended to use the 303 status code (see here). And while I can not speak about other HTTP clients, this best practice is being “enforced” …

---

## [How to redirect to external URL from live view?](https://forum.elixirforum.com/t/how-to-redirect-to-external-url-from-live-view/22141)

<div class="topic-metadata">

**Author:** [@vikramjadon921995](https://forum.elixirforum.com/u/vikramjadon921995)\
**Replies:** 1\
**Last updated:** [October 27, 2020, 3:31pm UTC](https://forum.elixirforum.com/t/how-to-redirect-to-external-url-from-live-view/22141 "2020-10-27T15:31:27Z")

</div>

I have to redirect to external google URL from live view. Currently I am using “redirect” method in live view. But it is nither redirecting nor giving any error.

---

## [LiveView: How to push\_redirect in mount (without full page reloads)?](https://forum.elixirforum.com/t/liveview-how-to-push-redirect-in-mount-without-full-page-reloads/34458)

<div class="topic-metadata">

**Author:** [@Sanjibukai](https://forum.elixirforum.com/u/Sanjibukai)\
**Replies:** 1\
**Last updated:** [September 18, 2020, 10:00pm UTC](https://forum.elixirforum.com/t/liveview-how-to-push-redirect-in-mount-without-full-page-reloads/34458 "2020-09-18T22:00:41Z")

</div>

Hi everybody, TL;DR: How to push\_redirect in mount without a full page reload? I have an application that handle localization with Gettext and I have a plug that set the selected locale in a cookie and in the session. …

---

## [Redirect - providing the missing redirect macro in Phoenix.Router 🙃](https://forum.elixirforum.com/t/redirect-providing-the-missing-redirect-macro-in-phoenix-router/27313)

<div class="topic-metadata">

**Author:** [@mathieuprog](https://forum.elixirforum.com/u/mathieuprog)\
**Replies:** 0\
**Last updated:** [December 3, 2019, 6:02pm UTC](https://forum.elixirforum.com/t/redirect-providing-the-missing-redirect-macro-in-phoenix-router/27313 "2019-12-03T18:02:44Z")

</div>

Hello :wave: In addition to forward/4, this library allows you to redirect a request from one path to another from your router.ex file: redirect "/path", "/new-path", :permanent # 301 redirect redirect "/path", "/new-p…

---

## [Trouble with Redirects](https://forum.elixirforum.com/t/trouble-with-redirects/24410)

<div class="topic-metadata">

**Author:** [@thread](https://forum.elixirforum.com/u/thread)\
**Replies:** 3\
**Last updated:** [August 10, 2019, 10:22pm UTC](https://forum.elixirforum.com/t/trouble-with-redirects/24410 "2019-08-10T22:22:14Z")

</div>

So I’m having trouble trying to do a simple redirect from a LiveView event handler, and I’m not sure where my difficulty lies… Firstly, is it possible to live\_redirect to an entirely different LiveView? (This code is in…

---

## [Dead-man Timer](https://forum.elixirforum.com/t/dead-man-timer/24422)

<div class="topic-metadata">

**Author:** [@bodhilogic](https://forum.elixirforum.com/u/bodhilogic)\
**Replies:** 1\
**Last updated:** [August 3, 2019, 3:08pm UTC](https://forum.elixirforum.com/t/dead-man-timer/24422 "2019-08-03T15:08:38Z")

</div>

I’ve been playing with GenServer timers and what I would like to do is run a GenServer timer that, when it processes the handle\_info() call, causes the web application to redirect to another page. A bonus would be for th…

---

## [Redirecting back to the referring page?](https://forum.elixirforum.com/t/redirecting-back-to-the-referring-page/18881)

<div class="topic-metadata">

**Author:** [@Rich\_Morin](https://forum.elixirforum.com/u/Rich_Morin)\
**Replies:** 4\
**Last updated:** [December 20, 2018, 9:08pm UTC](https://forum.elixirforum.com/t/redirecting-back-to-the-referring-page/18881 "2018-12-20T21:08:25Z")

</div>

I have a link to a controller that does some work, but doesn’t need to display a page. Instead, I’d like it to return to the referring page (defaulting to “/”) with a flash message. I found out (on StackOverflow) that I …

---

## [(exit) an exception was raised when I redirect somewhere in plug](https://forum.elixirforum.com/t/exit-an-exception-was-raised-when-i-redirect-somewhere-in-plug/17805)

<div class="topic-metadata">

**Author:** [@shahryarjb](https://forum.elixirforum.com/u/shahryarjb)\
**Replies:** 2\
**Last updated:** [November 8, 2018, 9:29pm UTC](https://forum.elixirforum.com/t/exit-an-exception-was-raised-when-i-redirect-somewhere-in-plug/17805 "2018-11-08T21:29:31Z")

</div>

Hello, when I want to redirect somewhere in my custom plug like blow code I have the (exit) an exception was raised error: my code: import Plug.Conn import Phoenix.Controller def init(default), do: default de…
