title: Nginx Rewrite: change only index location?
body: <p>How can I send a user to a new location, only if the user have no URI? I am trying the follow, but it does not works... it always send me to /newlocation</p>
  
  <pre><code>rewrite ^/$ http://www.domain.com/newlocation permanent;
  rewrite ^/(.*)$ http://www.domain.com/$1 permanent;
  </code></pre>
  
  <p>So basically, what I need is:</p>
  
  <p>If the user writes on browser www.domain.org it sends to www.domain.com/newlocation
  If the user writes on browser www.domain.org/something it sends to www.domain.com/something</p>
  
  <p>Thanks!</p>