You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable /@username URL patterns without middleware or rewrites
Support static optimization and ISR for user profile routes with @ prefix
Align Next.js routing with common social platform URL conventions (YouTube, TikTok, Instagram, X/Twitter)
Reduce unnecessary performance overhead for a widely-used URL pattern
Non-Goals
Changing or removing Parallel Routes functionality (the @ reserved character for slots)
Breaking existing applications that use Parallel Routes
Supporting every possible special character in routes (only focused on @ due to its prevalence)
Creating a complex escape system for all reserved characters
Background
Why this feature is needed
The /@username URL pattern is an established convention across major social platforms:
YouTube: youtube.com/@channelname
TikTok: tiktok.com/@username
Threads: threads.net/@username
Developers building social platforms, creator platforms, or user profile systems naturally want to follow this convention. However, Next.js reserves @ for Parallel Routes, making this impossible without workarounds.
✅ Better performance than middleware
❌ Still requires mental mapping between URL and file structure
❌ Complicates routing logic
❌ Requires maintenance of parallel route definitions
Alternative 3: Use /user/:username URLs
❌ Doesn't follow industry-standard URL patterns
❌ Less intuitive for users
❌ Breaks convention established by major platforms
Prior art
Remix: Supports $ for dynamic segments but also has reserved characters
SvelteKit: Uses [param] syntax without reserved prefix characters
Nuxt: Similar file-based routing, no @ conflicts
The difference is that @ specifically has become a de facto standard for user profiles across the web, making this limitation more impactful than other reserved characters.
Proposal
Option A: Escape syntax in folder names (recommended)
Allow developers to escape the @ character using a prefix or wrapper:
app/
(at)[username]/ // () group notation + "at" literal
page.tsx // Accessible at /@username
[videoId]/
page.tsx // Accessible at /@username/video123
or
app/
\@[username]/ // Backslash escape
page.tsx
Option B: New route.config.ts file
app/
@[username]/
route.config.ts
page.tsx
// route.config.tsexportconstconfig={literalPrefix: true// Treat @ as literal, not parallel route}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Goals
/@usernameURL patterns without middleware or rewrites@prefixNon-Goals
@reserved character for slots)@due to its prevalence)Background
Why this feature is needed
The
/@usernameURL pattern is an established convention across major social platforms:youtube.com/@channelnametiktok.com/@usernamethreads.net/@usernameDevelopers building social platforms, creator platforms, or user profile systems naturally want to follow this convention. However, Next.js reserves
@for Parallel Routes, making this impossible without workarounds.Current alternatives (and their drawbacks)
Alternative 1: Middleware rewrites
❌ Adds edge function execution overhead on every request
❌ Prevents optimal static generation
Alternative 2: next.config.js rewrites
✅ Better performance than middleware
❌ Still requires mental mapping between URL and file structure
❌ Complicates routing logic
❌ Requires maintenance of parallel route definitions
Alternative 3: Use
/user/:usernameURLs❌ Doesn't follow industry-standard URL patterns
❌ Less intuitive for users
❌ Breaks convention established by major platforms
Prior art
$for dynamic segments but also has reserved characters[param]syntax without reserved prefix characters@conflictsThe difference is that
@specifically has become a de facto standard for user profiles across the web, making this limitation more impactful than other reserved characters.Proposal
Option A: Escape syntax in folder names (recommended)
Allow developers to escape the
@character using a prefix or wrapper:or
Option B: New route.config.ts file
Option C: Double character for parallel routes
Change the parallel route syntax to require
@@:Recommendation
Option A (escape syntax) seems most aligned with Next.js conventions:
()conceptExample implementation
Accessible at:
domain.com/@usernameAm I interested in contributing?
Yes! If the team is open to this approach, I'm happy to:
Would love to hear feedback on which option (A, B, or C) would be most aligned with Next.js's architecture and future direction.
All reactions