title: window.history.replaceState() not working as I expect
body: <p>is there some way to replace url with JavaScript without reload? For example </p>
  
  <pre><code>www.url.com/index.php/presenter/view/../ 
  </code></pre>
  
  <p>to </p>
  
  <pre><code>www.url.com/presenter/view/../ 
  </code></pre>
  
  <p>?  I've tried it with history.replaceState function but it is only changing the url after <code>index.php</code>..</p>
  
  <pre><code>function parseUrl(){
      currUrl = window.location.href;
      verify = currUrl.indexOf("index.php");
      if(verify != -1){
          newUrl = currUrl.substring(0,verify-1);
          newUrl += '#'+currUrl.substring(currUrl.indexOf('index.php')+10,currUrl.length);
          if(window.history.replaceState){
              window.history.replaceState(null, this.title, newUrl);
          }
          else{
              window.location.href = newUrl;
          }
      }
  
  }    
  </code></pre>