Forum

rewrite for retinaimages.php

Dieter May
30 August 2016, 19:27
I have created a toolkit for the script retinaimages.php. The script loads higher resolution versions of images if they are exists. For me it works. I would be nice if a more expierenced hiawatha user have a look on it. If it is OK I would like to send it the developer of retinaimages.php. Perhaps he can add it to the existing examples for apache and nginx.
UrlToolkit {
ToolkitID = gotoretina
Header COOKIE devicePixelRatio=1 Goto retinaimages
}

UrlToolkit {
ToolkitID = retinaimages
Match .+(gif|jpe?g|png)$ Rewrite /retinaimages.php
}
Hugo Leisink
31 August 2016, 00:24
If it works, it works. Perhaps a shorter version:
UrlToolkit {
ToolkitID = retinaimages
Header Cookie !devicePixelRatio=1 Skip 1
Match .+(gif|jpe?g|png)$ Rewrite /retinaimages.php
}
Dieter May
31 August 2016, 15:04
Thank You Hugo for the short version, looks better!
This topic has been closed.