How can I use AliasMatch in httaccess to transfer a url like this : example.com/userName
to this url : example.com/user.php?name=userName
.
You don't need to use alias. Try this following code :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /user.php?name=$1 [L]