Skip to content

layer5labs/gatsby-plugin-meta-redirect

Travis

npm package

gatsby-plugin-meta-redirect

This is a forked version. Original plugin and repo available here.

MIT License Copyright (c) 2018 Get Chalk


Generates meta redirect html files for redirecting on GitHub Pages.

How to add to program

In your package.json

npm i https://github.com/layer5labs/gatsby-plugin-meta-redirect

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/'" />

About

Write Gatsby redirects to html files with a meta refresh

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published