I've tried to remove the .php extension and keep the id query parameter, but I get a 404 error.
This is the URL:
example.com/folder/file.php?q=123
And I want it to be:
example.com/folder/file/123
Here is my .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^$1/(.*)$ /$1.php?q=$2
/folder/file/123(since.htaccessitself doesn't actually "change" the URL). The.htaccessfile is presumably in the document root directory?/folder/file?