I have two types of URL and want to rewrite it for friendly URL.
1. The first:
I want to rewrite to:
2. The second:
I want it rewrite to:
Please help me how to do it. I've searched Google but I do not understand the principle rewrite.