user1745467
user1745467

Reputation: 67

need htaccess rule for reading images from different source

i have been trying to get work a htaccess rule for the below but i cannot figure it out.

/theimages/100/150/IMAGE-FOLDER-image.jpg

should read from :

/phpThumb/phpThumb.php?src=IMAGE/FOLDER/image.jpg&ae=1&w=100&h=150

any help appreciated thanks

Upvotes: 1

Views: 47

Answers (1)

anubhava
anubhava

Reputation: 784888

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On
RewriteBase /

RewriteRule ^theimages/([^/]+)/?$ phpThumb/phpThumb.php?src=$1 [L,NC,QSA]
RewriteRule ^theimages/(\d+)/(\d+)/([^-]+)-([^-]+)-([^-.]+\.jpg)$ phpThumb/phpThumb.php?src=$3/$4/$5&ae=1&w=$1&h=$2 [L,NC,QSA]

Upvotes: 2

Related Questions