|
Posted by 4sak3n 0ne on 10/27/07 21:14
On Oct 27, 12:58 pm, Kevin Blount <kevin.blo...@gmail.com> wrote:
> On Oct 27, 2:43 am, AnrDaemon <anrdae...@freemail.ru> wrote:
>
>
>
> > Greetings, Kevin Blount.
> > In reply to Your message dated Saturday, October 27, 2007, 01:39:14,
>
> > KB> AddType application/x-httpd-php .png
>
> > Useless.
>
> > KB> RewriteEngine On
> > KB> RewriteRule .png /phpsigs/create-sig.php
>
> > You forgot [QSA] flag. (Query String Append)
>
> > So,
>
> > RewriteEngine On
> > RewriteRule \.png$ /phpsigs/create-sig.php [QSA,L]
>
> > KB> basically just redirects all .PNG requests to a single PHP script, I
> > KB> can then grab the file name, etc and personalize the image being
> > KB> returned.
>
> > --
> > Sincerely Yours, AnrDaemon <anrdae...@freemail.ru>
>
> Thanks both.
>
> I did lose the AddType in the end, but didn't know about [QSA,L] -
> what does that do? seems to work ok without it, but would be good to
> know what it's for.
>
> Cheers
AddType defines the mime type of file extensions. mime types are how
the server knows the difference between images, plain text and other
files. This information also carries over to the browser so it is
able to display the information correctly.
I believe the original problem was that AddType image/png .png
occurred before you told Apache to parse it as php. I gather that it
defaulted to the first one defined.
In any case, defining the content type from within PHP is the best
option in this case. It prevents real pngs from being parsed as php.
Navigation:
[Reply to this message]
|