Simple one - but I would rather use location + rewrite vs if + rewrite (if is evil, correct?)

old url: /app?key=1234

new url: /system/app.html?key=1234

Tried

location  /app {
  rewrite ^/app$ /system/app.html break;
}

and only got a 404...

link|improve this question

70% accept rate
feedback

1 Answer

up vote 2 down vote accepted

try this

location  /app {
  rewrite ^/app(.*)$ /system/app.html$1 permanent;
}
link|improve this answer
perfect. thanks! – jimg Aug 18 '11 at 16:17
feedback

Your Answer

 
or
required, but never shown

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