It is a very common question on the internet but unfortunately, I didn't find any solution yet. My issue is, I already using below codes, which is working fine for article purpose (site.com/my-first-article).
#remove .php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
#for pretty url
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ blog.php?qTitle=$1 [NC,L]
But now i need (site.com/profile/user-name), when I copy and edit the code above for user profile it doesn't work.
#remove .php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
#for pretty url
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ profile.php?username=$1 [NC,L]
I hope I defined the question well and some can understand my issue. Thanks for your time.
My output
