944,199 Members | Top Members by Rank

Oct 14th, 2009
0

I need help rewriting dynamically-generated URLs

Expand Post »
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.
Similar Threads
Reputation Points: 16
Solved Threads: 9
Junior Poster
mexabet is offline Offline
148 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: One For All and All For One: A Single Linux Distribution
Next Thread in Linux Servers and Apache Forum Timeline: Please guide me in URL Rewriting plzzzzzzzzzzz





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC