Skip to content
Write Gatsby redirects to html files with a meta refresh
Branch: master
Clone or download
Latest commit d16a924 Nov 5, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.npmignore Don’t ignore source on publish Nov 5, 2018
.prettierrc Update prettier config Nov 5, 2018
.travis.yml Test new nodes Nov 5, 2018
LICENSE Add Travis CI build Jan 31, 2018
gatsby-node.js Remove Buffer.from call when writing file data Nov 5, 2018
getMetaRedirect.js Move gatsby-node to root Nov 5, 2018
package.json 1.1.1 Nov 5, 2018

Travis npm package


Generates meta redirect html files for redirecting on any static file host.


npm install --save gatsby-plugin-meta-redirect


yarn add gatsby-plugin-meta-redirect

How to use

// In your gatsby-config.js
plugins: [
  `gatsby-plugin-meta-redirect` // make sure to put last in the array


You can create redirects using the createRedirect action.

An example:

createRedirect({ fromPath: '/old-url', toPath: '/new-url', isPermanent: true });
createRedirect({ fromPath: '/url', toPath: '/zn-CH/url', Language: 'zn' });

That will generate the following html files:


<meta http-equiv="refresh" content="0; URL='/new-url/'" />



<meta http-equiv="refresh" content="0; URL='/zn-CH/url/'" />
You can’t perform that action at this time.