Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

is it possible to rewrite images? image store in /very/big/path/1.jpg , i want /img/1.jpg how can it be done?

share|improve this question
up vote 0 down vote accepted

I think its easier to use the search here at first.


type: "nginx rewrite" to the search.

And there are many more posts where you can see how redirecting work with nginx ;).


RewriteRule ^img/(.*)$ very/big/path/$1

something like this should work.

share|improve this answer
i need that img runs as php – kusanagi Mar 10 '11 at 14:11
ok and where is the problem? You should edit your question and write it more detailed. On the sites that i have posted you can see how the rewrite works ;) when you searh here you will find an answer i am sure... that were only 2 question from many. – Stony Mar 10 '11 at 14:16

Your Answer


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.