Creates an .htaccess based on your defined redirect rules.
npm install @thundersquared/gatsby-plugin-htaccess-redirectGenerates meta redirect html files for redirecting on any static file host.
``sh`
npm install --save gatsby-plugin-htaccess-redirect
or
`sh`
yarn add gatsby-plugin-htaccess-redirect
`jsgatsby-plugin-htaccess-redirect
// In your gatsby-config.js
plugins: [
// make sure to put last in the array`
];
You can create redirects using the createRedirect action.
An example:
`js`
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:
`html`
and
`html``
[build-badge]: https://img.shields.io/travis/thundersquared/gatsby-plugin-htaccess-redirect/master.png?style=flat-square
[build]: https://travis-ci.org/thundersquared/gatsby-plugin-htaccess-redirect
[npm-badge]: https://img.shields.io/npm/v/gatsby-plugin-htaccess-redirect.png?style=flat-square
[npm]: https://www.npmjs.org/package/gatsby-plugin-htaccess-redirect