Forum Moderators: phranque
So I thought I could use mod rewrite to allow me to apply the watermark whilst preserving the image filename - however I cannot work out how to get it to exclude certain files.
All the images have filenames with no prefix appart from my thumbnails which start t_ and my site graphics which start qt
eg
skylark.jpg - image needs watermarking
t_skylark.jpg - thumbnail does not need watermarking
qtBanner1.jpg - banner does not need watermarking
I''ve got as far as discovering that the following
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule /t_[a-z]+\.jpg$ watermark.php [QSA,NC]
will do the thumbnails only (the opposite of what I need). On my reading of regular expressions I was expecting that either
RewriteRule /!(t_[a-z]+)\.jpg$ watermark.php [QSA,NC]
or
RewriteRule /!(t_)[a-z]+\.jpg$ watermark.php [QSA,NC]
would invert that. But neither seems to do the trick. Any suggestions would be most welcome.
Thanks!
[quantumitger.org...]
Something like:
RewriteCond %{REQUEST_URI} !/(t_¦qt)[^/.]+\.jpg$
RewriteRule \.jpg$ /watermark.php [NC,L]
Replace the broken pipe "¦" character with a solid pipe character before use; Posting on this forum modifies the pipe characters.
Jim