Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Write Gatsby redirects to html files with a meta refresh

License

Notifications You must be signed in to change notification settings

nsresulta/gatsby-plugin-meta-redirect

Repository files navigation

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

About

Write Gatsby redirects to html files with a meta refresh

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •