
Ask HN: Is having a unique handle for profile pages a problem? - kadfak
Every major platform I know has their core entities behind a user chosen handle. Right now I&#x27;m deciding how to handle this matter for a web app I&#x27;m developing and my main concern is name squatting. There have been many discussions about squatting, here&#x27;s one about Rust&#x27;s package repository, crates.io[1], for example.<p>An alternative approach that I&#x27;ve been thinking about would be having a slug (for SEO purposes) and an ID in the URL: myapp.com&#x2F;page&#x2F;FancyCorporation&#x2F;mYlIcpWXpCG3GithkD2OdA. Although it makes the URL uglier, naming the thing is less stressful as every name is allowed. Another problem with this solution might be the fact that the slug part can be any string: myapp.com&#x2F;page&#x2F;asdasd&#x2F;mYlIcpWXpCG3GithkD2OdA and myapp.com&#x2F;page&#x2F;FancyCorporation&#x2F;mYlIcpWXpCG3GithkD2OdA point to the same profile. This allows bad actors to create URLs that look legit.<p>Am I overthinking or what do you think?<p>[1]: https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;9dole9&#x2F;proposal_crate_squatting_on_cratesio&#x2F;
======
karmakaze
Seems like there's two things here:

    
    
      1. username handles
      2. unique page urls
    

For the usernames I would use system generated (numeric or uuid) internal ids
that are associated with usernames.

For the page urls, I would let the author use any string, generating a semi-
meaningful default for seo. The page url should include the username handle
and so the unique part for the page only has to be unique for that username.

This means that say the db for page urls will have a unique constraint on
(user_id, page_url_suffix) where the user_id is the numeric/uuid one. So if
user with handle xxx is deleted and a new user uses handle xxx only the new
urls for that user are still accessible.

------
jamieweb
Have a look at OnioNS (Onion Name System). It's a method for allowing users to
claim unique names while limiting the effects of squatting, as it takes
continuous computational power to retain a name.

This probably isn't going to help with your web app, but it's an interesting
part of the theory to understand.

