tags:

views:

46

answers:

1

I only need to do this for one file (uptime.php) and it must be requested by using uptime.png.

Adding a rule for all png files in my config file would be suicide.. :P

+2  A: 

In general, it does not need to be requested by using uptime.png: you can use a .php extension. As long as your script outputs

Content-type: image/png

as the MIME type, browsers will recognise the data as an image.

However, if you really must use uptime.png for the URL, you can use a rewrite rule. For example:

url.rewrite-once = ( "^/uptime\.png$" => "/uptime.php" )

There is more information about these rewrite rules in the Lighttpd Docs::ModRewrite documentation.

Timwi
It could be that the OP has some other requirement that mandates what the name must be... but the question is unclear on that point :/
Matchu
Do I add that in the lighttpd config file?
Matt
Yes. Follow the link please.
Timwi