/Knowledge/sources/honojs__hono/llms-full/ssg-helper-plugins-redirect-plugin--939f71ffaf85.md
SSG Helper: Plugins > Redirect Plugin - hono-docs
SSG Helper: Plugins Redirect Plugin Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt redirect plugin Su...
SSG Helper: Plugins > Redirect Plugin
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#redirect-plugin
Summary
The redirectPlugin generates HTML redirect pages for routes that return HTTP redirect responses (301, 302, 303, 307, 308). The generated HTML includes a tag and a canonical link. ```ts import { toSSG, redirectPlugin, defaultPlugin...
Content
The redirectPlugin generates HTML redirect pages for routes that return HTTP redirect responses (301, 302, 303, 307, 308). The generated HTML includes a <meta http-equiv="refresh"> tag and a canonical link.
import { toSSG, redirectPlugin, defaultPlugin } from 'hono/ssg'
toSSG(app, fs, {
plugins: [redirectPlugin(), defaultPlugin()],
})
For example, if your app has:
app.get('/old', (c) => c.redirect('/new'))
The redirectPlugin will generate an HTML file at /old.html with a meta refresh redirect to /new.
[!NOTE] When used with
defaultPlugin, placeredirectPluginbeforedefaultPlugin. SincedefaultPluginskips non-200 responses, placing it first would preventredirectPluginfrom processing redirect responses.
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#redirect-plugin",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / SSG Helper > Plugins > Redirect Plugin",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 757,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "SSG Helper: Plugins > Redirect Plugin",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}