Dear folks,
Trying to rewrite images with a rewrite rule that should only fire when two conditions exist: image starts with IMG
or better yet IMG-
and secondly the file should exist.
Nice url: IMG-folder/file.jpg
fetched ugly url image under water.
The code below works when no conditions are set, as well as when only the second !-f condition is set, but not when both rules coexist. Why is this? Ideas/code/comments are very appreciated. Thanks
Q1. Im a bit confused: is the first condition actually necessary? Since I'm stating to only rewrite IMG-.... files to the ugly urls under water.
Q2. Why does this code below go wrong then both conditions are fired?
RewriteCond %{REQUEST_URI} ^IMG.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^IMG-(.+)_w(.+)_h(.+).jpg$ imgcpu\.php\?src=$1\.jpg&w=$2&h=$3 [L]