如何访问“网址”中的不同“群组”?

I'm trying to create a system where, a user registers, then they can be invited to a new 'area' or 'group' by an admin of that group.

What I don't know how to do is: I want a URL like mydomain.com/group/[groupname] - then this [groupname] needs to dsplay content specific to that 'group' and display content underneath it, such as mydomain.com/group/[groupname]/tasks

I have absolutely no idea how to A) pull the group name from the URL and B) display specific content based on that.

Could anyone help out? I tried to make the question as concise as possible, but I find it difficult to explain.

If you want your different groups to be only accessible by people added to that group, your best bet would be to create a MySQL database (which stores the registered users, of course), and have a table with the different groups.

You can then add a user to each group, and then query out who has access to that group. The admin of each group can then add users via an input that inserts the given user with permissions to access that group.

There are of course many ways of doing this, do you have any code already? Anything to work off?