Which is better (for the user, for longevity, for performance, for whatever) to have:
http://{site}/{login} e.g. http://wildobs.com/adam_jack
or
http://{site}/user/{login}
Pros of former:
Cons of former:
Clearly this is important to get right (or get wrong and stick to) since all user define URLs are based off it. Changing it would seem site suicide.
Do the cons (especially over time) outweigh the pros?
I would say the cons outweigh the pros, so go with /user/login over /login. Consider stackoverflow, since it's MVC as well: I think it's easier to program knowing that everything in /user/blah will always refer to a user, whereas if you don't do this you'll have to consider every possibility.
For example, in site/foo, foo could be a username, admin page, or some other keyword. It's much easier to deal with if you properly segment everything all out so you know if you see site/user/foo it's always a user named foo.
You might consider a third option:
Delimiting users with a single character, instead of a directory, as in unix.
http://site/~username
This can even result in a modrewrite to /user/username if that's more convenient.
Then you have short names, it's easy to deal with, and none of your regular pages will use that special character.
-Adam
There is a very important problem with allowing users to create arbitrary names in the webserver root (as they could by chosing their own login if you use /{login} instead of /user/{login}): some names have special magic meanings, and these meanings are defined by third parties. For instance:
There are several others; I have heard of sitemaps and files allowing extra cross-domain access, but there is no way I (or anyone else) can know all of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With