title: RedirectPermanent not redirecting to the url
body: <p>I'm coding a simple URL shortener.</p>
  
  <p>Everything is working, except the redirection.</p>
  
  <p>Here is the code that tries to redirect:</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; Click(string segment)
      {
          string referer = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : string.Empty;
          Stat stat = await this._urlManager.Click(segment, referer, Request.UserHostAddress);
          return this.RedirectPermanent(stat.ShortUrl.LongUrl);
      }
  </code></pre>
  
  <p>When I input a link that is shortened, like this <a href="http://localhost:41343/5d8a2a" rel="nofollow">http://localhost:41343/5d8a2a</a>, it redirects me to <a href="http://localhost:41343/www.google.com.br" rel="nofollow">http://localhost:41343/www.google.com.br</a> instead of www.google.com.br.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After checking the answer, it works. Here is the final snippet of code.</p>
  
  <pre><code>if (!stat.ShortUrl.LongUrl.StartsWith("http://") &amp;&amp; !stat.ShortUrl.LongUrl.StartsWith("https://"))
              return this.RedirectPermanent("http://" + stat.ShortUrl.LongUrl);
          else
              return this.RedirectPermanent(stat.ShortUrl.LongUrl);
  </code></pre>
  
  <p>Thanks!</p>