Skip to content

Instantly share code, notes, and snippets.

@jprieton
Last active September 24, 2020 14:06
Show Gist options
  • Save jprieton/b65b70fa8807bcb335e6 to your computer and use it in GitHub Desktop.
Save jprieton/b65b70fa8807bcb335e6 to your computer and use it in GitHub Desktop.
.htaccess para usar timthumb
# BEGIN TimThumb .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} (?i)(jpg|jpeg|png|gif)$
RewriteCond %{QUERY_STRING} h=([1-9]) [OR]
RewriteCond %{QUERY_STRING} w=([1-9])
RewriteRule (.*) ./path/to/timthumb.php?src=%{REQUEST_URI}&%{QUERY_STRING}
</IfModule>
# END TimThumb .htaccess
@jprieton
Copy link
Author

jprieton commented May 8, 2014

Uso:

<img src="http://path/to/image.gif?h=100&w=100">

@vlknu21
Copy link

vlknu21 commented Sep 24, 2020

it does not work.
what am i missing?

@vlknu21
Copy link

vlknu21 commented Sep 24, 2020

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} (?i)(jpg|jpeg|png|gif)$
RewriteCond %{QUERY_STRING} h=([1-9]) [OR]
RewriteCond %{QUERY_STRING} w=([1-9])
RewriteRule (.*) timthumb.php?src=%{REQUEST_URI}&%{QUERY_STRING}

htaccess and timthumb.php in same directory

and my image:
<img src="http://path/to/image.jpg?h=100&w=100">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment