Redirects suddenly adding extra element to redirect path

Site name: / syncora-utils

Yesterday we tested one of our functionalities, a simple short linking service, and we noticed the redirects not working anymore.
Looking into the logs, I noticed that the path that is being requested was wrong:

Original url:

Redirect config:

  from = "*"
  to = ""
  status = 200
  force = true

Expected redirect:
Actual redirect:

→ Notice the second /url in the path.

I tried redeploying: same result
I removed the /url from my redirect config: would redirect without any url parth in the path, as expected
Re added the correct part → again double /url in path

So there seems to be something broken at the moment, with no way of fixing it.
I did work around it by also acceping the double /url/url path in my application for now, but this gives me very litle confidence in the stability of the platform…

@Plutus Can you provide a URL that demonstrates the issue?

When I visit I receive only a 301 directly to

Is it that’s firing the 301?

Hi @nathanmartin ,

The fact that the url I gave in my original question redirects to is because of the workaround that I implemented. This is the intended behaviour.

For example, if I go back to my logs from yesterday from before I worked around the issue, I saw this entry when calling that url:

Feb 1, 11:17:20 PM: 9646a652 INFO [GET] /url/url/greatescape/bwsadd (SSR)

This should be url/greatescape/bwsadd given the rewrite I have configured.

Visiting the url also just gave a 404 not found error, because my next.js was not responding to those urls.

@Plutus I’d guessed the end result was likely due to the workaround.

Ignoring that, is the intended flow:

I’ve never seen a normal netlify redirect “add an extra piece of URL” like you’re describing here.

My own wild guesses would be:

  1. The URL was entered as which would result in


  1. There’s another redirect in effect somewhere, or something occuring within your next application, since you mention “logs” and point to an entry that mentions “SSR”.


  1. Perhaps you’re right, perhaps there’s something wrong with the Netlify redirects and I’ve just never encountered it before. Having a URL that demonstrates the issue would help people determine if that’s the case.

Hi @nathanmartin ,

I’ve just gotten around to setting up am identical test to what I have for my URL redirection, without doing an actual redirection, nor implementing the fix I did for my initial question.

The test can be performed here:

This should return exactly the same as this route:
Given that I have the following redirect in place:

  from = "*"
  to = ""
  status = 200
  force = true

But it serves a 404 on the url.

Looking at the logs, I get the following entry:
Feb 23, 11:33:04 AM: 7f88b054 INFO [GET] /test/test/a/b (SSR)

Which tells me the redirect is going to instead of what it is supposed to do.

This setup worked perfectly before my latest deploy of Februari 1st 2024, not sure what has changed in between that date and December 31st 2023 but this is when I first noticed the issue.

Logs can be found under the site

The code that handles this endpoint is very straightforward:

import { NextRequest, NextResponse } from "next/server";

type ShortLinkHandlerContext = {
  params: {
    tenantSlug: string;
    routeSlug: string;

export async function GET(
  request: NextRequest,
  { params: { tenantSlug, routeSlug } }: ShortLinkHandlerContext,
) {
  // Do nothing, just return some data
  return NextResponse.json({

The only other thing in the repository that could influence the routing should be the next.js middleware, but this is not triggering for those routes:

import { NextRequest, NextResponse } from "next/server";
import { verifySecret, m2mHeader } from "@syncora/shared/server/m2m";

export default function middleware(req: NextRequest) {
  if (!verifySecret(req.headers.get(m2mHeader))) {
    return new NextResponse("Cannot access this endpoint", { status: 400 });

export const config = {
  // Match ALL api routes, except for the webhooks, they should be public
  matcher: "/api/((?!webhooks).*)",

There is not much more to the repository than this.

@Plutus I just created a “Drag & Drop” deployment consisting only of:


/*  200!

Visiting https://65d87c3e5f14bedba869f73d– receives a 308 status, pushing to a location of /test

Visiting the path /a/b does work:

Visiting your URL of receives a 308 status, pushing to a location of /test/test

Visiting the path /a/b does not work - which will be because it’s going to /test/test/a/b as your logs indicate.