/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-redirect-plugin-932998ddee0f-redirect-plugin-s0757-c0000.md

Redirect Plugin - hono-docs

Redirect Plugin Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt redirect plugin Summary The redir...

Redirect Plugin

Source evidence: /Sources/raw/honojshono/honojshono.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, place redirectPlugin before defaultPlugin. Since defaultPlugin skips non-200 responses, placing it first would prevent redirectPlugin from processing redirect responses.

Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-redirect-plugin-932998ddee0f-redirect-plugin-s0757-c0000.md
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.