I have url like http://localhost/site/blog.php?id=31
and id is being used on the page blog.php to get the content but i want to show the url like this http://localhost/site/blog/id/31
for seo purpose.It is also fine if url displays like localhost/site/id/3
1 or any other similar pattern. It is just that code which displays contents is in blog.php and it uses ID parameter to display contents. I have tried following methods but nothing has worked so far. any help from all you experts out there?
RewriteEngine On
RewriteRule ^([^/]+)/?$ site/blog?id=$1 [QSA]
and
RewriteEngine On
RewriteRule ^/?id/([^/]+)/?$ site/blog.php?id=$1 [L,QSA]