|
Posted by Ian Hobson on 01/30/08 23:16
Erwin Moller wrote:
> Peter wrote:
>> (Apologies if this is sent twice, server issues it seems)
>>
>> Hi,
>>
>> I use something like this:
>>
>> RewriteRule ^(.*).png$ ../../templates/png_help/$1.png
>>
>
> Maybe you can solve this with a rewriterule, but I don't know how.
> Alternatively you can simply call a PHPscript that returns the png.
>
> From HTML, instead of:
> <img src="templates/png_help/example.png">
>
> you write:
>
> <img src="mypngscript.php?png=example.png">
>
> And let mypngscript.php handle all complex path stuff.
>
> Regards,
> Erwin Moller
>
>
If you do this, don't forget to set the headers correctly.
I had to use the following when generating a .pdf (which I did not want
cached).
header('Content-Disposition: inline; filename="'.$this->pdfFilename().'"');
header('Content-type: application/pdf');
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header('Expires: '.date(DATE_COOKIE,time()-120));
header('Pragma: public');
You can find the correct value for your content-type line in the
mime.types file in your Apache configuration directory.
Regards
Ian
[Back to original message]
|