[b].htaccess[/b]
[code]
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} MSIE\ [0-6]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*).png$ png2gif.php?url=$1.png
[/code]

[b]png2gif.php[/b]
[code]
<?php

/**
 * Please do not delete these lines!
 * 
 * @author Jonathan
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version 1.1
 */

/**
 * Configuration
 */

/**
 * Root-path
 * Usefull when this script is not in your root
 */
define('ROOT', './');

/**
 * Cache-folder
 * Please create an empty folder and CGMOD to 0777
 */ 
define('CACHE', ROOT . 'png2gif/');

/**
 * Script
 */

define('URL', ROOT . $_GET['url']);
$hashUrl = md5(URL);

$createImage = true;

$cachedName = CACHE . $hashUrl . md5(filemtime(URL)) . md5_file(URL);
$cachedType = null;

if (file_exists($cachedName))
{
    $createImage = false;

    if (filesize($cachedName))
    {
        $cachedType = 'gif';
    }
    else
    {
        $cachedType = 'png';
        $cachedName = URL;
    }
}
else
{
    $cachedFiles = scandir(CACHE);

    foreach ($cachedFiles as $cachedFile)
    {
        if (substr($cachedFile, 0, 32) == $hashUrl)
        {
            unlink(CACHE . $cachedFile);
            break;
        }
    }
}

if ($createImage)
{
    $size = getimagesize(URL);
    $width = $size[0];
    $height = $size[1];

    $source = imagecreatefrompng(URL);
    $alpha = false;

    for ($x = 0; $x < $width; $x++)
    {
        for ($y = 0; $y < $height; $y++)
        {
            $color = imagecolorsforindex($source, imagecolorat($source, $x, $y));

            if ($color['alpha'])
            {
                $alpha = true;
                break 2;
            }
        }
    }

    if ($alpha)
    {
        $image = imagecreatetruecolor($width, $height);
        $background = imagecolorallocate($image, 255, 255, 255);
        imagefill($image, 0, 0, $background);
        imagecolortransparent($image, $background);
        imagecopyresampled($image, $source, 0, 0, 0, 0, $width, $height, $width, $height);
        imagegif($image, $cachedName);

        $cachedType = 'gif';
    }
    else
    {
        file_put_contents($cachedName, null);

        $cachedType = 'png';
        $cachedName = URL;
    }
}

header('Content-type: image/' . $cachedType);
readfile($cachedName);
exit;
[/code]