More on server-side image resizing

This is a follow-up about my modest plugin to use Timthumb to grab dynamically resized images for WordPress.

When we last checked in, my plugin called “ImgSize” was triggered whenever a thumbnail image was requested, and it provided a Timthumb-resized version. Shortly after this, I added the functionality to the plugin to do the same thing for any image that showed up in a post as well. Almost immediately, Google Analytics registered a large drop in traffic to my blog. Google Image Search was no longer indexing my images because their urls were now all to *.php files. I removed the new feature, and the traffic gradually came back.

I returned to the plugin and fixed the indexing problem by adding an .htaccess file to the plugin folder. This file turns on some URL-rewriting, which allows us to place the PHP script call behind an image-like url. Now instead of having an image tag asking for a source like this –

http://truthpluslies.com/wp-content/plugins/imgsize/timthumb/timthumb.php?src=http://truthpluslies.com/wp-content/uploads/hepburn-skateboarding.jpg&w=260

– The tag can request this much friendlier URL –

http://truthpluslies.com/wp-content/plugins/imgsize/resize/260/wp-content/uploads/hepburn-skateboarding.jpg

– And the lovely .htaccess file changes it into the correct request.

I’ve been running this modification on my site for a few weeks and can report no effect on my web traffic or search engine ranking. If you want to try it for yourself, here’s the source: ImgSize

Tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>