Hello, I'm using .htaccess to show existing images instead of images which does not exist. RewriteBase /images/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)_(.*)1200x900\.jpg$ esittely_$21200x900.jpg RewriteRule liiga1200x10.jpg esittely1200x10.jpg RewriteRule liiga670x10.jpg esittely670x10.jpg [L] Everyting works fine if an image does not exist. But if an image does exist, the second RewriteRule RewriteRule liiga1200x10.jpg esittely1200x10.jpg will be used. Why is that so? How could I modify my code to prevent that?
Hello, I also have an another problem. I have this code: RewriteBase /images/ RewriteCond %{REQUEST_URI} ^/(.*)/(.*)$ RewriteRule liiga([0-9]{3,4})x10.jpg esittely$1x10.jpg [L] When I'm surfing on myexamplewebsite.com/kemii/liigasu.shtml, the RewriteCond is true. Everything is OK. When I'm surfing on myexamplewebsite.com/liigasu.shtml, the RewriteCond is true. Why is that so?
Let's put this all that way: RewriteBase /images/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)_(.*)1200x900.jpg esittely_$21200x900.jpg RewriteRule (.*)1200x10.jpg esittely1200x10.jpg RewriteRule (.*)670x10.jpg esittely670x10.jpg [L] When I arrive to myexamplewebsite.com/liigasu.shtml (no subdirectory), I would like to skip all the RewriteRules. When I arrive to subdirectory (for example: myexamplewebsite.com/kemii/liigasu.shtml), the RewriteRules should change these: (.*)_(.*)1200x900.jpg -> esittely_$21200x900.jpg (.*)1200x10.jpg -> esittely1200x10.jpg (.*)670x10.jpg -> esittely670x10.jpg