Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a rewrite rule for Nginx which will rewrite all images on:

http://mysite.com/index.php/article/foo/images/image.(png|jpg|gif)

to address:

http://mysite.com/images/image.(png|jpg|gif)
share|improve this question
up vote 2 down vote accepted

You'll want something like:

 rewrite ^/index.php/article/foo/images/(.*).(png|jpg|gif) /images/$1.$2 ;
share|improve this answer
    
Thanks, it works :D – jpyzio Mar 11 '12 at 23:24
    
Heh, any chance you can accept or +1 the answer in the next 30 minutes? I'm trying to hit 200 points in a day! – cjc Mar 11 '12 at 23:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.