I need every help I can get to rewrite the URLs dynamically generated by a PHP photo album script.
These examples are how the URLs show on web browsers:

index.php?page=list-image&album=1 (The URL of "album 1" while I name the album "Tropical Islands") and index.php?page=list-image&album=2 (The URL of "album 2 while the name might be something like " Exotic Beaches" or "Beaches").

How can I rewrite the above-mentioned "album 1" URL to be: "Tropical_Islands/" and subsequent dynamically-generated albums to appear that way.

This is an example of how the image URLs show:
index.php?page=image-detail&album=1&image=1 (The URL of "image 1" of "album 1" while I name this image "Buddha Temple")

I want the image URLs to be in this form: "Tropical_Islands/Buddha_Temple/"

Can anyone please show me how to rewrite the album and image URLs in order to have search engine-friendly URLs. I have tried a few tricks I know, but nothing works. My inability to achieve this stemmed from my lack of knowledge. What I need is to tell me the exact lines to remove and giving me the code to replace them.