title: Remove hash and load URL minus hash
body: <p><code>enter code here</code>This JavaScript snippet removes the <code>/#/and/everything/after</code> from URL, and reloads the page. </p>
  
  <pre><code>var loc = window.location.href,
      index = loc.indexOf('#');
  
  if (index &gt; 0) {
    window.location = loc.substring(0, index);
  }
  </code></pre>
  
  <p>As a result, something like this:</p>
  
  <pre><code>http://www.somesite.com/#/somepage
  </code></pre>
  
  <p>reloads as this:</p>
  
  <pre><code>http://www.somesite.com
  </code></pre>
  
  <p>How can I modify the snippet, to make it remove only this part: <code>#/</code>, but keeo everything that comes after it, and load the page at the url that has everything before and after <code>#/</code>, like this:</p>
  
  <pre><code>http://www.somesite.com/somepage
  </code></pre>