I don't know a whole lot about the intricacies of SEO so I was wondering if someone here could provide some insight to this problem.

When you use the php script timthumb on a website, it means images are referenced in the HTML as a PHP script rather than a jpg, png, etc.

After some reading on the net I learned that apparently this is bad for SEO, can someone confirm this? I don't know the details but it was something about the images not being indexed properly. I would definitely appreciate some more education on this issue.

I did some research and after looking at a google group discussion this is the solution I came up with to put in my .htaccess:

RewriteEngine On
RewriteRule ^thumb/([0-9]*)x([0-9]*)/(.*)/([0-9]*)/([0-9]*)/(.*) http://xxxxxxxx.org/wordpress/wp-content/themes/tireconnection/functions/timthumb.php?src=http://xxxxxxxx.org/wp-content/uploads/$4/$5/$6&h=$2&w=$1&a=$3 [R=301,L]

This means that in the HTML itself, the images are referenced as .jpg or .png files. However when you visit that .png or .jpg directly it redirects you to the timthumb script.

Can someone tell me if this is a proper solution to the problem? (Assuming there is actually a problem to begin with)

1 Answer 1


If you are wanting to get your images indexed for the appropriate keywords, that would often be included in the filename of the image, then referencing a php file without these keywords is not going to benefit SEO. Google doesn't only get keywords from the image filename, but it is a big clue, and it is helpful to users.

I can see that a RewriteRule directive in htaccess can help here, in order to make it look like you are referencing an ordinary, keyword rich, image filename, but direct requests to your PHP script in the background. However, I would not use a 301-external-redirect (R=301). This tells the search engines that the image is really located at the original destination URL - which is the one that will be indexed - so you are back at square one. Do an internal rewrite instead and omit the R flag.

  • 1
    So, there is a god. Perfect mate, did the trick. One thing I also had to do was remove the full URL from the rewrite rule as that implied an external rewrite. May 1, 2013 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.