title: How to "get back to root path" in Flask?
body: <p>I am very new and inexperienced to Flask and web development. This is probably a duplicate of another question but I cannot find the answer or question I am looking for.</p>
  <p>Basically I have a page with a form that is used to get query parameters from a database. I list those entries and make a link in one of the fields to go into detailed view (and have a delete button). The url for the form would be: <code>127.0.0.1:5000/form-page</code>. When going into detailed view I currently do it as <code>127.0.0.1:5000/form-page/data_1/data/2</code>. When I then press a button for another link, say to go to index, I don't end up in <code>127.0.0.1:5000/index</code> but <code>127.0.0.1:5000/form-page/data_1/data/2/index</code> instead.</p>
  <p>-EDIT-</p>
  <p>What I used which didn't work was</p>
  <pre><code>&lt;div class=&quot;topnav&quot;&gt;
      &lt;a href=&quot;index&quot;&gt;&lt;h1&gt;Page title&lt;/h1&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  <p>meanwhile the following works</p>
  <pre><code>&lt;div class=&quot;topnav&quot;&gt;
      &lt;a href={{ url_for(&quot;index&quot;) }}&gt;&lt;h1&gt;Page title&lt;/h1&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  <p>-END EDIT-</p>
  <p>My question is: How do I get back to &quot;the root&quot; url from pressing buttons</p>
  <p>I know using <code>/value_1/value_2</code> might be the wrong convention for passing data. I've seen <code>?key=value</code> but don't know how to implement that either or when it is correct to use one or the other.</p>