I want that every user has a profile-url like this:
www.example.com/username
But my php page need the id of the user ( not username ).
for example I want that this url:
www.example.com/profile.php?id=13
become:
www.example.com/john
what I have to write in the htaccess ?
There is no magic answer to this question. You obviously need to have a PHP script that is able to take a username as a query parameter:
Then you can use mod_rewrite:
The above rewrite rule will match any string not containing a dot, this may or may not fit your needs, depending on your overall url structure.