I have made sure that rewrite engine is enabled and removing .php extensions is working so I know that isn’t the issue.
what I’m trying to do is simply remove the ?id=value aspect of the URL, so basically making the URL look like such:
folder/medias/value
Instead of
folder/medias?id=value
My current .htaccess looks like this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
RewriteRule ^404/?$ /404.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ 404.php [L,R]
2
Answers
With your shown samples/attempts, please try following htaccess Rules. Please make sure to clear your browser cache before testing your URLs.
You may try this code inside the
/folder/.htaccess
(create this file if it doesn’t exist):?
in first rule is to remove query string from original URL.%{REQUEST_FILENAME} !-f
and%{REQUEST_FILENAME} !-d
is to skip existing files and directories from rewrite in 2nd rule.