Skip to content

Commit

Permalink
update redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrickaby committed Nov 12, 2024
1 parent c87a80a commit ddbc1a1
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
return [
{
source: '/r',
destination: '/',
permanent: true
}
]
// If the app is deployed on Vercel, redirect to the custom domain.
if (process.env.VERCEL_ENV === 'production') {
return [
{
source: '/',
destination: 'https://reddit-viewer.com/',
permanent: true
},
{
source: '/r/:path*',
destination: 'https://reddit-viewer.com/r/:path*',
permanent: true
}
]
} else {
return [
{
source: '/r',
destination: '/',
permanent: true
}
]
}
},
logging: {
fetches: {
Expand Down

0 comments on commit ddbc1a1

Please sign in to comment.