title: How to redirect to another subpage using JQuery
body: <p>I have the link</p>
  
  <p><a href="http://www.example.com/mysite/administration/objects" rel="nofollow">http://www.example.com/mysite/administration/objects</a></p>
  
  <p>I want to redirect to page</p>
  
  <p><a href="http://www.example.com/mysite/administration/reports" rel="nofollow">http://www.example.com/mysite/administration/reports</a></p>
  
  <p>using jquery. But I don't want to write the direct link, only replace <code>objects</code> to <code>reports</code> I want something like this</p>
  
  <pre><code>window.location = './reports;
  </code></pre>
  
  <p>but I get
  .../administration/objects/reports</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>And what if I pass some id in request</p>
  
  <p><a href="http://www.example.com/mysite/administration/objects/33" rel="nofollow">http://www.example.com/mysite/administration/objects/33</a></p>
  
  <p>I still want to get
  <a href="http://www.example.com/mysite/administration/reports" rel="nofollow">http://www.example.com/mysite/administration/reports</a></p>
  
  <p>If I use replace() I get the wrong url
  <a href="http://www.example.com/mysite/administration/reports/33" rel="nofollow">http://www.example.com/mysite/administration/reports/33</a></p>