Skip to content

Instantly share code, notes, and snippets.

@adrienharnay
Created September 27, 2021 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrienharnay/e67f328d0e827eb1008f16e9d98ecbe6 to your computer and use it in GitHub Desktop.
Save adrienharnay/e67f328d0e827eb1008f16e9d98ecbe6 to your computer and use it in GitHub Desktop.
test Next.js host redirection
rewrites: () => {
return {
beforeFiles: [
{
source: '/',
has: [
{
type: 'host',
value: `garage-(?<slug>.*).ad-ad-fr-review-test-redir-khdq54.review.ad.fr`,
},
],
destination: `https://ad-ad-fr-review-test-redir-khdq54.review.ad.fr/garage/garage-:slug`,
},
{
source: '/:path*',
has: [
{
type: 'host',
value: `garage-(?<slug>.*).ad-ad-fr-review-test-redir-khdq54.review.ad.fr`,
},
],
destination: `https://ad-ad-fr-review-test-redir-khdq54.review.ad.fr/garage/garage-:slug/:path`,
},
],
fallback: [
{
source: '/:path*',
destination: `${process.env.SITE_URL}/:path*`,
},
],
};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment