I’m curious about how make the correct development, I have the next URL “http://www.mysite.com/user/name” (the word “name” can be “jonh”, “rachel”, …). The word name will be registered by the user logged in, if a guest visit “http://www.mysite.com/user/jonh” then he will be directed to jonh’s site…
But if I have an action named "create" in the UserController and the user logged in try to register the next URL "http://www.mysite.com/user/create" it will be a big problem.
My question is, how to make it to work fine and safe?
Remembering that UserController is used to register a new User and give to this User one shortcut to "his site".
You don’t actually have to have the url contain ‘missingAction’. Your user controller would have a function called missingAction what happens is when a route points at your controller and they app can’t find the action in the controller it then calls the missingAction function, from there you can do what you want.
See this post for an example of how I used the missing action function.
Some of what you need to do is just have a list of user names they just can’t use your original way would work but you’d need to prevent your users from registering user names that are action names. If you go with the 2 controllers, one controller could handle the register/log in and other user functions and you could have the second controller handle then accessing their user page.