Skip to main content
Routing rules live in pxxl.toml, deploy with your code, and roll back with it. This page has ready-to-copy recipes. Every key and limit is in the pxxl.toml reference. All routing needs version = 1 at the top of the file.

Single-page app

Serve index.html for routes like /dashboard/settings:

Clean URLs

Serve /about from about.html (static sites):

Redirect an old path

status is required: 301, 302, 307, or 308.

Redirect to another domain

Proxy an API

Keep calls same-origin (no CORS) by proxying /api to your backend:
The URL in the browser doesn’t change. The method, body, cookies, and Authorization header are passed on.

Cache static assets

Security headers

Only for some visitors

Send social media bots to an image function:

Already have vercel.json?

If pxxl.toml has no routing, Pxxl reads rewrites, redirects, headers, cleanUrls, and has/missing from vercel.json. Don’t define routing in both files: the deploy fails. The old routes key isn’t supported.

Check your rules

The deploy log says which file the rules came from: pxxl.toml, vercel.json, or platform defaults. If a rule is invalid, the deploy fails with a message such as:
Your current deployment stays live. Fix the file and push again.