website: reset redirects file (#12966)
* website: reset redirects file * docs: add note on product prefix in redirects, with example
This commit is contained in:
parent
1dbc204d24
commit
97a6d689f7
@ -1,122 +1,30 @@
|
|||||||
// REDIRECTS FILE
|
/**
|
||||||
|
* Define your custom redirects within this file.
|
||||||
// See the README file in this directory for documentation. Please do not
|
*
|
||||||
// modify or delete existing redirects without first verifying internally.
|
* See the README file in this directory for documentation. Please do not
|
||||||
// Next.js redirect documentation: https://nextjs.org/docs/api-reference/next.config.js/redirects
|
* modify or delete existing redirects without first verifying internally.
|
||||||
|
*
|
||||||
module.exports = [
|
* Vercel's redirect documentation:
|
||||||
{ source: '/home', destination: '/', permanent: true },
|
* https://nextjs.org/docs/api-reference/next.config.js/redirects
|
||||||
{ source: '/support', destination: '/', permanent: true },
|
*
|
||||||
{ source: '/sponsors', destination: '/', permanent: true },
|
* Relative paths with fragments (#) are not supported.
|
||||||
{ source: '/about', destination: '/intro', permanent: true },
|
* For destinations with fragments, use an absolute URL.
|
||||||
|
*
|
||||||
|
* Playground for testing url pattern matching: https://npm.runkit.com/path-to-regexp
|
||||||
|
*
|
||||||
|
* Note that redirects defined in a product's redirects file are applied to
|
||||||
|
* the developer.hashicorp.com domain, which is where the documentation content
|
||||||
|
* is rendered. Redirect sources should be prefixed with the product slug
|
||||||
|
* to ensure they are scoped to the product's section. Any redirects that are
|
||||||
|
* not prefixed with a product slug will be ignored.
|
||||||
|
*/
|
||||||
|
module.exports = [
|
||||||
|
/*
|
||||||
|
Example redirect:
|
||||||
{
|
{
|
||||||
source: '/v1/:path*',
|
source: '/vagrant/docs/internal-docs/my-page',
|
||||||
destination: 'https://docs-v1.vagrantup.com/:path*',
|
destination: '/vagrant/docs/internals/my-page',
|
||||||
permanent: true,
|
permanent: true,
|
||||||
},
|
},
|
||||||
{
|
*/
|
||||||
source: '/blog/:path*',
|
|
||||||
destination: 'https://hashicorp.com/blog/:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/download-archive/:path*',
|
|
||||||
destination: 'https://releases.hashicorp.com/vagrant',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{ source: '/intro/index', destination: '/intro', permanent: true },
|
|
||||||
{ source: '/docs/index', destination: '/docs', permanent: true },
|
|
||||||
{
|
|
||||||
source: '/docs/virtualbox/:path*',
|
|
||||||
destination: '/docs/providers/virtualbox/:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/docs/vmware/:path*',
|
|
||||||
destination: '/docs/providers/vmware/:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/docs/docker/:path*',
|
|
||||||
destination: '/docs/providers/docker/:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/docs/hyperv/:path*',
|
|
||||||
destination: '/docs/providers/hyperv/:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/docs/vagrant-cloud',
|
|
||||||
destination: '/vagrant-cloud',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/docs/vagrant-cloud/:path*',
|
|
||||||
destination: '/vagrant-cloud/:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
// Redirect "getting started" guides to Learn
|
|
||||||
{
|
|
||||||
source: '/(docs|intro)/getting-started',
|
|
||||||
destination:
|
|
||||||
'https://learn.hashicorp.com/collections/vagrant/getting-started',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/(docs|intro)/getting-started/project_setup',
|
|
||||||
destination:
|
|
||||||
'https://learn.hashicorp.com/tutorials/vagrant/getting-started-project-setup?in=vagrant/getting-started',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/(docs|intro)/getting-started/synced_folders',
|
|
||||||
destination:
|
|
||||||
'https://learn.hashicorp.com/tutorials/vagrant/getting-started-synced-folders?in=vagrant/getting-started',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/(docs|intro)/getting-started/:path*',
|
|
||||||
destination:
|
|
||||||
'https://learn.hashicorp.com/tutorials/vagrant/getting-started-:path*',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/docs/why-vagrant',
|
|
||||||
destination: '/intro#why-vagrant',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/boxes',
|
|
||||||
destination: 'https://app.vagrantup.com/boxes',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/boxes/search',
|
|
||||||
destination: 'https://app.vagrantup.com/boxes/search',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/downloads\\.(html?)?',
|
|
||||||
destination: '/downloads',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/download',
|
|
||||||
destination: '/downloads',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/vmware',
|
|
||||||
destination: '/docs/providers/vmware',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: '/vmware/reseller',
|
|
||||||
destination: '/docs/providers/vmware',
|
|
||||||
permanent: true,
|
|
||||||
},
|
|
||||||
// disallow '.html' or '/index.html' in favor of cleaner, simpler paths
|
|
||||||
{ source: '/:path*/index', destination: '/:path*', permanent: true },
|
|
||||||
{ source: '/:path*.html', destination: '/:path*', permanent: true },
|
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user