How can I rewrite url?

My current url is:
http://localhost/demo/posts.php?post_id=6

I want to change this to:
http://localhost/demo/post/6

I am using .htaccess, but dont know how to create rules…

MohsinAli,

mod_rewrite is a very powerful tool available on Apache servers (and a more complex version on M$ servers, too) which can do this very easily. However, rather than repeat the tutorial article linked in my signature here, please click “Articles” below and then come back with any question you might have.

Regards,

DK