I am trying to set up URL like www.example.com/username for something like www.example.com/profile.php?name=username
I tried this in my .htaccess
RewriteEngine on
RewriteRule ^user/(.*)$ profile.php?name=$1 [NC,B,QSA]
but this makes it work for all the pages. I want this to work only when URL is like www.example.com/username but it works also for www.example.com/users.php
If users.php or any other .php file is opened then the rewrite rule should not be applicable to it.
How can this be achieved?