.htaccess file:
# Modified .htaccess file.
#
# I replaced (.*) with ([a-z0-9]+) to stop extra slashes, removed a redundant rule,
# and added one for URLs with just the profile.

RewriteEngine On
RewriteRule ^([a-z0-9]+)/?$ profile.php?id=$1 [NC,L]
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)/?$ profile.php?id=$1&goto=$2 [NC,L]

# Just some housekeeping
ErrorDocument 404 /index.php

Contents of $_GET:
Array
(
    [id] => bulat
    [goto] => friends
)

This file is profile.php.