title: Loop to match both URLs that go to the same page
body: <p>On my website both the following URLs go to the same page:<br>
  <a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/" rel="nofollow">https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Site URL<br>
  <a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/index.html" rel="nofollow">https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/index.html</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Index page URL</p>
  
  <p>I have a loop to highlight the current page link in the navigation menu:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Index&lt;/title&gt;
      &lt;style&gt;
          ul {
              list-style-type: none;
              margin: 0;
              padding: 0;
          }
          li {
              display: inline;
          }
          a.current {
              background: red;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/index.html"&gt;Index&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/news.html"&gt;News&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/contact.html"&gt;Contact&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/about.html"&gt;About&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
      &lt;h1&gt;Index&lt;/h1&gt;
      &lt;script&gt;
          for (var i = 0; i &lt; document.links.length; i++) {
              if (document.links[i].href == document.URL) {
                  document.links[i].className = 'current';
              }
          }
      &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><br>
  Now the problem is it doesn't highlight the <em>Index</em> link when you go to the main site URL:<br>
  <a href="https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/" rel="nofollow">https://googledrive.com/host/0B5jOXzxlxbMhaERteVA4cmJwdDg/</a></p>