title: Redirecting links via Greasemonkey
body: <p>I want to redirect a URL to a different URL. For example, if I were to type in:</p>
  
  <pre><code>google.com
  </code></pre>
  
  <p>and hit enter, it should redirect me to:</p>
  
  <pre><code>yahoo.com
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/3168944/how-can-i-redirect-some-page-with-javascript-in-greasemonkey">I was at a previous thread and found a code for this</a>, but unfortunately, it works on ALL URLs, which I don't want. Also, once the redirect is complete (at yahoo.com) the page will reload again, endlessly looping.</p>
  
  <p>EDIT: Current Code:</p>
  
  <pre><code>  // ==UserScript==
  // @name        Google to Yahoo
  // @description Redirects Google to Yahoo
  // @include     http://*.google.*/*
  // @version     1
  // ==/UserScript==
      if(content.document.location == "http://google.com"){
              window.location.replace("http://yahoo.com")
  }
  </code></pre>