Skip to content
Docs
 

Configuration Redirects

Configuration redirects define routing rules that Edgenivo evaluates at build time. Use them for permanent redirects (308), temporary redirects (307), and geolocation-based routing.

Define configuration redirects in your framework's config file or in the vercel.json file, which is located in the root of your application. The vercel.json should contain a redirects field, which is an array of redirect rules. For more information on all available properties, see the project configuration docs.

vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "redirects": [
    { "source": "/me", "destination": "/profile.html" },
    { "source": "/user", "destination": "/api/user", "permanent": false },
    {
      "source": "/view-source",
      "destination": "https://github.com/vercel/vercel"
    },
    {
      "source": "/:path((?!uk/).*)",
      "has": [
        {
          "type": "header",
          "key": "x-vercel-ip-country",
          "value": "GB"
        }
      ],
      "destination": "/uk/:path*",
      "permanent": false
    }
  ]
}

View the full API reference for the redirects property.

Using has does not yet work locally while using vercel dev, but does work when deployed.

When using Next.js, you do not need to use vercel.json. Instead, use the framework-native next.config.js to define configuration-based redirects.

next.config.js
module.exports = {
  async redirects() {
    return [
      {
        source: '/about',
        destination: '/',
        permanent: true,
      },
      {
        source: '/old-blog/:slug',
        destination: '/news/:slug',
        permanent: true,
      },
      {
        source: '/:path((?!uk/).*)',
        has: [
          {
            type: 'header',
            key: 'x-vercel-ip-country',
            value: 'GB',
          },
        ],
        permanent: false,
        destination: '/uk/:path*',
      },
    ];
  },
};

Learn more in the Next.js documentation.

When deployed, these redirect rules will be deployed to every region in Edgenivo's CDN.

The source pattern matches only the path, so you can't match a query string in source. To redirect based on a query parameter, add a has condition with type set to query:

vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "redirects": [
    {
      "source": "/specific/:path*",
      "has": [{ "type": "query", "key": "page", "value": "home" }],
      "destination": "/another/:path*",
      "permanent": false
    }
  ]
}

A request to /specific/mypath?page=home&id=1000 redirects to /another/mypath?page=home&id=1000 with a 307 status. A request to /specific/mypath?page=about doesn't match, so no redirect happens. Use missing instead of has to redirect only when a parameter is absent.

The request's query string passes through to the destination. If the destination has its own query parameters, Edgenivo combines them. For example, a rule with "source": "/" and "destination": "/new?path=foo" redirects /?baz=10 to /new?path=foo&baz=10.

For all has and missing options, see the redirects reference. In Next.js, redirects() in next.config.js accepts the same has syntax.

The /.well-known path is reserved and cannot be redirected or rewritten. Only Enterprise teams can configure custom SSL. Email us to learn more.

If you are exceeding the limits below, we recommend using Middleware and Global Config to dynamically read redirect values.

LimitMaximum
Number of redirects in the array2,048
String length for source and destination4,096
Last updated August 11, 2026

Was this helpful?

supported.