Hi all; Here is a problem that I have tried to solve for three days now but cannot work around : when I call timthumb on an Image I get the whole command line and its variables in the url of the Image Location like this, <img src="/scripts/timthumb.php?src=/images/whatever.jpg&w=150&h=200&zc=1" alt="" /> HTML: timthumb resize the Image and save it by an encoded name in the cash directory, I want to assign the source attribute in the image tag to the encoded name not to the command but don't know how to hack the code to show the coded url . Anyone have tried this before or knows about it can help .. Thank you
You have to find how timthumb generates that encoded name and use the same algorithm to asign source of your images
Johnta, I would be grateful if you could share the actual HTACCESS solution you applied. I have been searching for a while for a solution to the same TimThumb ugly URL problem.
Ok Non probs. Inside your script that generates the image , encode the generated url and add an extension like .png. send this encoded url to the script timthumb.php create .htaccess file in the timthumb folder to redirect the address from the one you have encoded to the one required by timthumb.php script. Inside the timthumb.php decode the coming url, explode it , then send its components to the script. Easy ..
Thanks for the response. Not sure I understand completely: 1) When you say "inside the script that generates the images, encode the URL" -- are you talking about inside the TimThumb php file? 2) Why add a .png extension? I'd love to see your code...unfortunately I know a little, but not enough to do what you described.
<img src=../thumb/' <? (Put the variables required by timthumb script here) encoded using base64_encode function ) . '.png' ?> /> Code (markup): Then, inside the thumb folder put this htaccess file <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^([^_]*)\.png$ timthumb.php?src=$1 [L] </IfModule> Code (markup): Now inside the timthumb.php script explode the request and use its components as your variables.
Sorry to necropost but I would just LOVE an elegant solution to this TimThumb SEO issue. TimThumb seems to be in almost every Wordpress theme I like, and it mangles the image URLs so badly that it surely has a negative SEO impact for people who want their images to show up in image search engines. If there's an easy way to fix this I'd be in your debt!