mexabet 49 Good Learner

I need your help to rewrite the URLs generated dynamically by a PHP photo album software.
These are how the URLs currently show on the browser:

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

I need help to make the above-mentioned "album 1" URL to be: "Tropical_Trees/" and other albums to be in this form.

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

I want the image URLs to be in this form: "Tropical_Trees/Buddha_Statue/"

Can anyone please show me how to rewrite the album and image URLs in order to have search engine-friendly URLs. I have tried without success to achieve this. This is what I have done so far:

## mod_rewrite configuration
Options +FollowSymLinks

# Turn on the rewriting engine
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ - [F]

RewriteRule ^[a-zA-Z]$ index.php?page=list-image&album=$0
RewriteRule ^([a-zA-Z])\/$ /$1 [R]

RewriteRule ^([A-Z]+)([a-z)]+)([0-9)]+)\.html$ index.php?page=image-detail&album=1&image=$3

RewriteRule  ^([^/]+)/$ index.php?page=image-detail&album=1&image=$1

#Options -Indexes IncludesNOEXEC FollowSymLinks

I will appreciate your kind assistance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.