I tried a lot for URL rewriting rules in htaccess, but now I'm stuck. i have to change this url
products.php?id=31
to
products/31
I used
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^forums/ - [L,NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
using this, I get the following result:
products?id=31
But that does not work. Any ideas?
source
share