So let's say I have a url
https://website.com/file.php?test
I'd like for this to be rewritten to
I've tried using many solutions on the web but none work on my site for whatever reason.
My current HT access file is:
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]
This code successfully removes the .php extension so that I am able to have urls like website.com/file?test and not file.php?test.