Next.js Discord

Discord Forum

Dynamic route in NextJS for username /@[username]

Unanswered
Madeiran sardinella posted this in #help-forum
Open in Discord
Madeiran sardinellaOP
Wondering how one would go about doing this where a dynamic route starts with @ symbol. I can't seem to figure it out, the only alternative would be to have all usernames in my database start with @, i'm trying to avoid this.

5 Replies

Asian black bear
You’d have to escape it but it’s still broken IIRC. Also using @ in URLs is a recipe for disaster. Just don’t.
@Asian black bear You’d have to escape it but it’s still broken IIRC. Also using @ in URLs is a recipe for disaster. Just don’t.
Madeiran sardinellaOP
yeah this seems like the best way to go about it, simplest
ty 🫡