By jrandol
via coding.scribd.com
Published: Sep 04 2010 / 05:52
There are a lot of really hard ways of going about this, many of which will break over time. I opted to go with the a reliable way of doing this: I build a list of known routes, strip them down to their first path component, then build an array of these reserved names. A known route might be, for instance, /documents/:id; its first path component is "documents." Thus, a user whose login is "documents" cannot have a vanity URL.



Add your comment