@rahulephp
this is done by the rewrite module of apache and this handles regular expressions. You have to put a rule like this in your .htaccess file on the root of your website:
RewriteRule ^product/([0-9]+)$ /page.php?id=$1
^ means the start of the url after
www.example.com/
$ means the end of the page.
www.example.com/product/123 will be converted by the server to:
www.example.com/page.php?id=123
In PHP you use the normal $_GET['id'] variable. The rewrite module must be enabled by apache... This is mostly used to make the url format independent of the serverside scripting language so the .php in the url is not logical. Thats why i changed it to product/ . The .htaccess starts with
RewriteEngine On
Options +FollowSymLinks
RewriteBase /
Here all the rewrite rules..
...
...
Hope this will help you on your way.