Hi,
We've successfully completed our migration of 120,000 images (it took a while lol) and for the most part it's working very well.
We do have some instances where we have some broken images that we have linked to in articles. This was expected as those are actually no longer there
However, whilst doing this, I wondered if the following was possible.
eg on this page
http://www.spoilertv.com/2015/03/chicago-pd-episode-218-get-back-to-even.htmlYou will see some broken image links.
Each of these img src values look like this
http://www.spoilertv.co.uk/images/zp-core/i.php?a=Chicago PD/Season 2/Promotional Episode Photos/Episode 2.18 - Get Back to Even&i=NUP_167772_0075.JPG&s=100&c=1&cw=100&ch=100&q=100&t=1&wmk=!
Now that is fine and as I said expected.
Would it be possible somehow, I suspect through htaccess, that when it comes across a broken link that it instead displays a standard image. (Our image will say something like "The Thumbnail is currently missing, however clicking on me will load the correct page")
eg something like what tinypic do ( Screenshot
http://tinypic.com/images/404.gif )
I'm not sure if there is a simple htaccess rule that could be written.
Any help, much appreciated.
Comments
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule \.(gif|jpe?g|png|bmp) missing.png [NC,L]
You can see it working here
http://www.spoilertv.com/2015/03/chicago-pd-episode-218-get-back-to-even.html
However it seems that the other broken ones are not being detected as images but a php?
Not sure if there is anything that can be done.
This is the link to the image processor so technically a php page until the image is cached which of course does not happen if it is not there anymore.
Not sure that is possible with htaccess as that of course cannot know about zp internal image processing.
Do you think it's possible, that I could somehow edit the i.php file so that if an image is not there, that the i.php file returns a default image?
Why does my link here
http://www.spoilertv.co.uk/images/zp-core/i.php?a=Chicago PD/Season 2/Promotional Episode Photos/Episode 2.18 - Get Back to Even&i=NUP_167772_0075.JPG&s=100&c=1&cw=100&ch=100&q=100&t=1&wmk=
Not return an image but rather an error ?
See Screenshot
http://i.imgur.com/8EEd8NX.png
It will redirect here
http://images.spoilertv.com/Chicago PD/Season 2/Promotional Episode Photos/Episode 2.18 - Get Back to Even/
Here is the redirected link that does not throw the default image.
http://images.spoilertv.com/zp-core/i.php?a=Chicago%20PD/Season%202/Promotional%20Episode%20Photos/Episode%202.18%20-%20Get%20Back%20to%20Even&i=NUP_167772_0075.JPG&s=100&c=1&cw=100&ch=100&q=100&t=1&wmk=
Could you explain please a little more about the Base URL? Is that a setting in the config?
So if you have links in your database that are the wrong site you can find them and replace the site part with the appropriate token. You would do this with your MySQL GUI--see your hoster for how to access it. Simple SQL statements can make the replacements. You just need to know what tables and columns to examin. In your case that is most likely the `news` table and the `content` column.
Once those tokens are in place zenphoto will replace them with the correct site link before they are placed on any content pages.