Hi, I have this file:
www.mysite.com/images/example.jpg
if the filename contains "_800" (i.e.: www.mysite.com/images/example_800.jpg)
I rewrite to "img.php"
RewriteRule ^images/([^/]+)(_[0-9]+)(\.(gif|jpg|jpeg|png))$ img.php?img=$1&ext=$4&size=$3&type=$2&height=0&con=i [L]
a script that resizes the image "example.jpg" width to 800px and saves the new image under "images/resized/":
www.mysite.com/images/resized/example_800.jpg
The question is:
How to rewrite
www.mysite.com/images/example_800.jpg
to
www.mysite.com/images/resized/example_800.jpg
when "resized/example_800.jpg" exists, and redirect to
img.php
when "resized/example_800.jpg" doesn't exist?
Andrea
www.mysite.com/images/example.jpg
if the filename contains "_800" (i.e.: www.mysite.com/images/example_800.jpg)
I rewrite to "img.php"
RewriteRule ^images/([^/]+)(_[0-9]+)(\.(gif|jpg|jpeg|png))$ img.php?img=$1&ext=$4&size=$3&type=$2&height=0&con=i [L]
a script that resizes the image "example.jpg" width to 800px and saves the new image under "images/resized/":
www.mysite.com/images/resized/example_800.jpg
The question is:
How to rewrite
www.mysite.com/images/example_800.jpg
to
www.mysite.com/images/resized/example_800.jpg
when "resized/example_800.jpg" exists, and redirect to
img.php
when "resized/example_800.jpg" doesn't exist?
Andrea




