I am building a website and I would like to customize the users\' profile so their profile url shares their name. For example, the website domain would be www.example.com an
You are looking for a RewriteRule. I think the following should do:
RewriteRule ^(.*)$ index.php?username=$1 [NC]
This will convert the displayed url (www.example.com/myusername), to an url with a GET parameter for your index.php. This new url that you can use internally will look like this:
www.example.com/index.php?username=myusername
Update: Here is an extra clarification to answer the questions in your comment:
The RewriteRule above does exactly what you are asking. The user can enter an url like www.example.com/username, which will be internally rewritten (without the user ever noticing it) to www.example.com/index.php?username=myusername. That way you can access the get variable ($_GET["username"]), without the user ever seeing it exists.
Nice tutorials can be found here and here.