Change initial load URL?

So because of the way the platform works, whenever I make an edit I have to sign back into my app each time.

Because the app loads into / on load I have to sit through the auth & redirect loop to get back to the login page

image

Because its a proto I’m building I don’t care tooooo much about the auth process, but this one is eating 60-90s each load as it goes through the loops and gets be back to login (I’ve tried to fix this but it ate too many tokens without progress so I gave up)

Is there any way I can configure it so that when in preview, it always loads into a specific defined page in my app? (In my case I’d want /auth/login)

So outside of v0, I’d recommend doing it this way:

vercel.json Redirects (the easiest)

If you don’t mind redirecting the root path, just drop this into your vercel.json:

{
  "redirects": [
    {
      "source": "/",
      "destination": "/auth/login",
      "permanent": false
    }
  ]
}

Super simple and works across all environments.

Here’s a suggested prompt you can paste directly into v0 to implement this:

“Update my project so that preview deployments automatically redirect / to /auth/login. Use the simplest approach. Add a vercel.json file at the project root with a non-permanent redirect from / to /auth/login. If a vercel.json already exists, merge the redirect into the existing config without breaking anything else.”

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.