Skip to main content
Version: v0.x

How do I redirect traffic to other places?

Proxyflare can redirect traffic from absolute or wildcard pathnames on your domain to other places.

functions/_middleware.ts
const redirectRoute: Route = {
from: { pattern: "proxyflare.works/redirect" },
to: {
url: "example.com",
// permanently redirect traffic to example.com
statusCode: 301,
},
}

const routes = [redirectRoute]

This route redirects traffic on proxyflare.works/redirect to example.com because it contains a 3xx statusCode.

Providing a statusCode is useful for redirects or any time you want to lock the response status code on a Route.