Skip to content

Instantly share code, notes, and snippets.

@zofe
Created May 11, 2014 19:23
Show Gist options
  • Save zofe/f58e5f6f587d28f44415 to your computer and use it in GitHub Desktop.
Save zofe/f58e5f6f587d28f44415 to your computer and use it in GitHub Desktop.
## timthumb
http://timthumb.googlecode.com/svn/trunk/timthumb.php
(download and configure cache path)
## .htaccess
RewriteRule ^thumb/(\d+)x(\d+)/f(\d)/q(\d{2})/(.*) /public/images/timthumb.php?src=/$5&w=$1&h=$2&f=$3&q=$4 [L]
RewriteRule ^thumb/(\d+)x(\d+)/f(\d)/(.*) /public/images/timthumb.php?src=/$4&w=$1&h=$2&f=$3 [L]
RewriteRule ^thumb/(\d+)x(\d+)/(.*) /public/images/timthumb.php?src=/$3&w=$1&h=$2 [L]
## example
/thumb/80x120/path/of/source.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment