antv-l7/node_modules/gatsby-plugin-meta-redirect
thinkinggis f7e5376b7d fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
..
node_modules/fs-extra fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
.prettierrc fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
.travis.yml fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
LICENSE fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
README.md fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
gatsby-node.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
getMetaRedirect.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
index.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
package.json fix(fix css): fix css png 2019-11-22 18:04:14 +08:00

README.md

Travis npm package

gatsby-plugin-meta-redirect

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

Install

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

or

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
];

Redirects

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:

/old-url/index.html:

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

and

/url/index.html:

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