Comments (2)
Hey @zevi-wiply! There are several ways you can avoid/improve this:
- Redirect subdomain to custom domain if exists: We actually have a section of the code that lets you do that: https://github.com/vercel/platforms/blob/main/app/%5Bdomain%5D/layout.tsx#L105-L112
- Setting a canonical URL that points to the custom domain if it exists: https://github.com/vercel/platforms/blob/main/app/%5Bdomain%5D/layout.tsx#L50-L56
from platforms.
How about this as a "yes, and", to prevent duplicate paths ever being selected for pre-render:
const allPaths = allSites
.flatMap(({ subdomain, customDomain }) => [
subdomain &&
!customDomain /* <----- Only include subdomains where there's no customDomain */ && {
domain: `${subdomain}.${process.env.NEXT_PUBLIC_ROOT_DOMAIN}`,
},
customDomain && {
domain: customDomain,
},
])
.filter(Boolean);
from platforms.
Related Issues (20)
- Custom domain should not be unique
- Desperate need for help... The Middleware behaves unpredictabily and I can't get hostname HOT 5
- Adding NextAuth
- Bug: Adding a custom domain with an initial misconfigured DNS config keeps staying in error mode forever
- request headers host unexpectedly changed
- Error when deploying Django App on Vercel
- How to load different UI configurations based on the tenant? HOT 5
- how to invalidate all a pages of a [domain] route
- Title and description fields within the post editor do not trigger the save function as expected, also infinite loop on editor page related to nav.tsx HOT 4
- How to get this to work with next-auth v5? HOT 3
- Support for internationalization HOT 3
- When accessing blog created on localhost, it returns 404 how do I solve this HOT 2
- Edge function Error : ERR_MODULE_NOT_FOUND on an installed module HOT 1
- Errors are not showing on login page because of redirects in middleware HOT 1
- minor: (invalid?) use of promises HOT 1
- Stuck on "add your root domain & wildcard domain." from guide HOT 4
- Bug: able to create sites with blank site name & description HOT 1
- Use custom domain for Preview Deployments HOT 1
- can we use platforms without vercel HOT 2
- Adding custom domains without relying on subdomains
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from platforms.