title: Next.js Redirect from / to another page
body: <p>I'm new in <em>Next.js</em> and I'm wondering how to redirect from start page ( <strong>/</strong> ) to <strong>/hello-nextjs</strong> for example. Once user loads a page and after that determine if path === <strong>/</strong> redirect to <strong>/hello-nextjs</strong></p>
  
  <p>In <em>react-router</em> we do something like:</p>
  
  <pre><code>&lt;Switch&gt;
    &lt;Route path="/hello-nextjs" exact component={HelloNextjs} /&gt;
    &lt;Redirect to="/hello-nextjs" /&gt; // or &lt;Route path="/" exact render={() =&gt; &lt;Redirect to="/hello-nextjs" /&gt;} /&gt;
  &lt;/Switch&gt;
  </code></pre>