Reply to Re: function call in .htaccess ?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация