I want to resize images with the size in the url like this: http://www.domain.nl/images/chached/200x200/name.jpg If the image doesn't exist I want to generate and cache it.
How do I after that check if the file exists, with out having to generate the folder '200x200' in the /images/chached/ directory and without the use of PHP(slower).
Is there a way to do this with mod_rewrite(faster)? Or is this just not possible?
I'm using Kohana 3 witch uses this mod_rewite code:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
# RewriteBase /kohana/
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]