Remix has a useful redirect helper function which helps to quickly create a new redirect Response. You can use this function to redirect from a loader or action to another app route and another website.
import { redirect } from "@remix-run/node";
export const action = async () => redirect("https://vanxh.dev");
Just return a redirect response with the URL you want to redirect. You can also pass a status code as a second argument, which defaults to 302.
You can do the same from a loader:
export const loader = async () => redirect("https://vanxh.dev");
Top comments (0)