Now 100x Faster

Read the latest from Gatsby CTO Kyle Mathews Re-introducing Gatsby, a Reactive Site Generator

ContactSign Up for Free
Community Plugin
View plugin on GitHub

Travis npm


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


npm install --save gatsby-plugin-htaccess-redirect


yarn add gatsby-plugin-htaccess-redirect

How to use

// In your gatsby-config.js
plugins: [
  `gatsby-plugin-htaccess-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/'" />
© 2022 Gatsby, Inc.