@iandolan/astro-redirects
v0.1.1
Published
Redirect table that compiles to nginx, Cloudflare, Astro and .htaccess, plus 404 target suggestion.
Maintainers
Readme
@iandolan/astro-redirects
One redirect table in the repo, reviewed in a diff, compiled to whatever your edge runs. Replaces Redirection and the Rank Math redirect manager, and closes the gap that costs rankings when a site leaves WordPress. Nothing lives only in a control panel nobody has the login for.
# propose a table by matching old URLs against the new sitemap
seokit-redirects plan --old export.wxr --new dist/sitemap-0.xml -o redirects.csv
# compile
seokit-redirects compile redirects.csv --format nginx -o dist/redirects.conf
# validate, and confirm every target actually exists
seokit-redirects check redirects.csv --sitemap dist/sitemap-0.xml
# ask which rule a path would hit
seokit-redirects test redirects.csv /blog/my-old-postOutput formats: nginx, redirects (Cloudflare Pages and Netlify), astro, htaccess. The nginx output uses a map rather than hundreds of location blocks, which matters once a WordPress migration brings a thousand old URLs.
Chains collapse (A to B to C becomes A to C). Loops and duplicate sources are errors and block compilation, because emitting a config from a table with a loop in it deploys the loop.
plan fuzzy-matches dead URLs against live ones and grades each match. Only high-confidence matches are marked auto-appliable, and even those are meant to be read in a diff. A wrong redirect is worse than a 404. It hides the problem and sends people to the wrong page. Matches it cannot make are listed as # NO MATCH rather than guessed at.
Part of the Dolan SEO Suite, WordPress SEO plugin functionality rebuilt for static Astro sites. Plain ESM, no build step.
MIT © Ian Dolan
