htaccess – Problem with URL path when I applied SEO friendly URL

I was working on PHP project and making SEO friendly URL Like,


New :

Here is my .htaccess file:

RewriteEngine on
Options -MultiViews

RewriteCond %{QUERY_STRING} ^q=(.*)$
RewriteRule ^list_product$ /list_product/%1? (R=301,L)

RewriteRule ^list_product/(.*)$ list_product.php?q=$1 (L)

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ /$1.php (NC,L)

It’s working well but my link path has been changed to:

But I need this to be:

It adds list_product, but it’s not working. Does anyone know why this is happening?