Help with rewrite rule

14 views
Skip to first unread message

Ilan Berkner

unread,
Jan 1, 2012, 9:20:23 PM1/1/12
to ng...@nginx.org
I'm trying to rewrite any png files referenced through the fancybox sub directory to a directory off of the images folder as follows:
  
rewrite ^/fancybox/(.+\.png)$ /images/fancybox/$1 last;

This is not working, probably b/c my regex is off the mark.  Any suggestions?

Thanks

Ilan Berkner

unread,
Jan 1, 2012, 9:27:34 PM1/1/12
to ng...@nginx.org
Solved it with this rule:

    rewrite ^(.*)/fancybox/(.+\.png)$ /images/fancybox/$2 last;
--

Ilan Berkner
Chief Technology Officer
Time4Learning.com

6300 NE 1st Ave., Suite 203
Ft. Lauderdale, FL 33334

  

Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade.
Time4Writing.com - Online writing tutorials for high, middle, and elementary school students.
Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more.
spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students.


Reply all
Reply to author
Forward
0 new messages