Examples
Redirect to another domain
Send every request to a different domain with Response.redirect.
This script redirects all incoming requests to one URL with a permanent
redirect (HTTP status code 301).
Last modified on August 17, 2026
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Send every request to a different domain with Response.redirect.
import * as BunnySDK from "@bunny.net/edgescript-sdk";
BunnySDK.net.http.serve(
async (request: Request): Response | Promise<Response> => {
const destinationURL = "https://example.com";
const statusCode = 301;
return Response.redirect(destinationURL, statusCode);
},
);