gatsby-plugin-meta-redirect is a Gatsby plugin designed to generate static HTML files containing a `<meta http-equiv="refresh">` tag. This enables client-side redirects on any static file host, such as S3 or Netlify, without requiring server-side redirect rules or `.htaccess` configurations. The plugin processes `createRedirect` actions called within Gatsby's Node API (e.g., in `gatsby-node.js`) and outputs an `index.html` file at the `fromPath` containing the meta refresh tag pointing to the `toPath`. Currently at version 1.1.1, the package has not seen updates in over seven years, indicating an abandoned maintenance schedule. Its primary differentiator is the universal compatibility across static hosts, but this comes with SEO and user experience trade-offs compared to server-side 301 redirects.
npm install gatsby-plugin-meta-redirectVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure `gatsby-plugin-meta-redirect` in `gatsby-config.js` and how to define redirects using Gatsby's `createRedirect` action within `gatsby-node.js` for both static and data-driven redirect scenarios. It illustrates basic permanent redirects, language-specific redirects, and iterating over markdown frontmatter to generate redirects programmatically.
Ensure `gatsby-plugin-meta-redirect` is the final plugin listed in `gatsby-config.js`.
For SEO-critical permanent redirects, prefer hosting-provider-specific 301 redirect solutions (e.g., Netlify `_redirects` file, Vercel redirects in `vercel.json`, or server-side configurations) if your host supports them. Use this plugin when server-side control is not available or for non-SEO-critical temporary redirects.
Evaluate alternatives like `gatsby-plugin-client-side-redirect` (though also old) or server-side redirect solutions provided by your hosting provider. For new projects, consider Gatsby versions that have native redirect capabilities or more actively maintained plugins.
Move `gatsby-plugin-meta-redirect` to the very end of the `plugins` array in your `gatsby-config.js` file.
For critical redirects, implement true 301 server-side redirects via your hosting provider's configuration (e.g., `_redirects` file for Netlify/Vercel, NGINX rules for custom servers) instead of relying solely on meta refresh. Update internal links and sitemaps to point to the final URLs.