I would like to use following URL for my web site.
http://mywebsite.com/product.php
to
http://mywebsite.com/product
http://mywebsite.com/product.php?id=5
to
http://mywebsite.com/product/5
http://mywebsite.com/product.php?action=delete&id=5
to
http://mywebsite.com/product/delete/5
http://mywebsite.com/product.php?action=edit&id=3
to
http://mywebsite.com/product/edit/3
I use this code on my .htaccess file
RewriteEngine on
RewriteRule ^product product.php
RewriteRule ^product/([a-zA-Z0-9_-]+)$ product.php?id=$1
RewriteRule ^product/([a-zA-Z0-9_-]+)/$ product.php?id=$1
But problem is when i use http://mywebsite.com/product/5 and display with GET variable, it does not pass the id parameter and how can i achieve the multiple query from my url?