URL Rewriting in .htaccess for url friendly : I have a URL that looks like:

> domain.com/category.php?id=5

and

> domain.com/profile.php?id=2

How would I go about converting that URL to:

> domain.com/categoryname
> 
> domain.com/profilename


.htaccess code:

    RewriteEngine on
    #category
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^([^/.]*)$ category.php?id=$1
    #profile
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^([^/.]*)$ profile.php?&id=$1

But that works only for category !

Thanks