Super User is a question and answer site for computer enthusiasts and power users. 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

Let's say a user tries to access a given image on my website using the following url:

i need a rewrite rule to this, removing the 'blog' node from the path:

share|improve this question
up vote 11 down vote accepted

Try this one:

location /blog {
 rewrite ^/blog(/.*)$ $1 last;

If you need this for more than one site you can't just put it higher in hierarchy because "location" clause can't be specified globally, only for specific site. If you need to add this clause for two sites or more you can put it another config file and then just "include" it in each site that needs this redirection.

share|improve this answer
This works for in the same server. How to make it work for the different domain? – Millisami May 6 '13 at 9:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .