I'll create a custom page that handles subdomains client-side, reading the subdomain once on initial load and rendering the appropriate content.
This custom page handles subdomains client-side with the following features:
Key Features:
useEffect with an empty dependency arraywindow.location.hostname to parse the subdomain?subdomain=admin)Supported Subdomains:
admin.yourdomain.com - Admin dashboard with metricsapp.yourdomain.com - Main application interfacesupport.yourdomain.com - Support center with ticketsyourdomain.com - Main landing page showing available subdomainsFor Development: Test locally by visiting:
localhost:3000?subdomain=adminlocalhost:3000?subdomain=applocalhost:3000?subdomain=supportFor Production: The page will automatically detect subdomains from the hostname. Make sure your Vercel project is configured to handle wildcard domains 12.