All guides

Set up Selvio on Vercel with vercel.json

For sites hosted on Vercel without Next.js: two rewrites in vercel.json, a redeploy, and the check.

Where the rule goes

Open vercel.json at the root of the project (the Root Directory set in Vercel), or create it. This guide is for sites on Vercel built without Next.js: static sites, Astro, Vite, SvelteKit… For a Next.js app, follow the Next.js guide.

The rule

For example.com, with the pages under /compare/. In the dashboard, the same rule is already filled in with your domain and path: copy it from there. If your pages exist in several languages, it has one more block per language (/fr/compare/…).

vercel.json
{
  "rewrites": [
    {
      "source": "/compare",
      "destination": "https://pages.selvio.io/_h/example.com/compare/"
    },
    {
      "source": "/compare/",
      "destination": "https://pages.selvio.io/_h/example.com/compare/"
    },
    {
      "source": "/compare/:path*",
      "destination": "https://pages.selvio.io/_h/example.com/compare/:path*"
    }
  ]
}

After

Commit, then redeploy. Vercel reads vercel.json at each deployment.

Check

Open https://example.com/compare/_selvio/proxy-check in a browser, or run this command. The address must answer 200 with this text: selvio-proxy example.com.

Terminal
curl -i https://example.com/compare/_selvio/proxy-check

Then click I deployed it, check in the dashboard: it reads the same address on your domain. The check works before anything is published.

Common pitfalls

The people leaving your competitor will read a page. Make it yours.

Enter your site: Selvio picks up your brand style, suggests your competitors and checks their prices.

Free, no credit card. Nothing goes live without you.