Welcome! Log In Create A New Profile

Advanced

Help me make this FUGLY rewrite rules nice

Posted by gog 
gog
Help me make this FUGLY rewrite rules nice
April 14, 2011 06:10PM
I have an ugly, "just make it work" version of the rewrite rules that I am trying to simplify, but no luck.
You can look at my working rewrite, and the one that doesn't work here https://gist.github.com/920669

This is what I am trying to achieve:

- when http://hostname/img/123456.jpg is requested:
1. do an internal rewrite to /repository/images/1/2/3/123456.jpg
2. if /repository/images/1/2/3/123456.jpg does not exist rewrite to /api/image.php?filename=123456.jpg and pass this uri to the proxy
3. if it exists, set expires max; headers and deliver the file

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready