Forum Topic: Rewrite timthumb to actual url

Forum: .htaccess Forum : General • Posted by Jeroen • Updated:

Jeff, I'm stuck with this one. I hope you can help, because I can't find anything working online.

I'd like to rewrite the timthumb url to the actual image url. What I have now (at doesn't work) is this

RewriteRule ^wp-content/themes/THEME/timthumb.php?src=http://DOMAIN.COM/wp-content/uploads/([a-zA-Z0-9]+).jpg&h=&w=240&zc=1$ SUBDIR/wp-content/uploads/$1.jpg [L,R=301]

The timthumb url that used to work before I changed the website was this

http://DOMAIN.COM/wp-content/themes/THEME/timthumb.php?src=http://WWW.DOMAIN.COM/wp-content/uploads/IMAGENAME.jpg&h=&w=240&zc=1

I'm getting a lot of 404s now and I want to get rid of them.

Any ideas?

Cheers
Jeroen

1 Reply to “Rewrite timthumb to actual url”

Jeff Starr
Posted by Jeff Starr

Hi Jeroen,

Sorry for missing this post!

I think it will be possible to redirect such requests using the QUERY_STRING variable to match everything after timthumb.php (see page 90 for more infos!)