title: SEO issue and remove a trailing slash from URL
body: <p>We have a web site written in ASP.NET. When you open the following page:</p>
  
  <p><a href="http://concert.local/elki/" rel="nofollow">http://concert.local/elki/</a></p>
  
  <p>You can see the slash "/" at the end. We need to remove it in order to have:</p>
  
  <p><a href="http://concert.local/elki" rel="nofollow">http://concert.local/elki</a></p>
  
  <p>I've tried some things to make it work, but it doesn't help. For example, when I add the following code in Global.asax.cs file:</p>
  
  <pre><code>protected void Application_BeginRequest(Object sender, EventArgs e)
  {
      if (HttpContext.Current.Request.Url.ToString().Contains("http://concert.local/elki/"))
      {
          HttpContext.Current.Response.Status = "301 Moved Permanently";
          HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower().Replace("http://concert.local/elki/", "http://concert.local/elki"));
      }
  }
  </code></pre>
  
  <p>The following error comes up:</p>
  
  <pre><code>Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
  
  This problem can sometimes be caused by disabling or refusing to accept cookies.
  </code></pre>
  
  <p>There is also the following code:</p>
  
  <pre><code>&lt;asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentHead"&gt;
      &lt;link rel="canonical" href="http://concert.local/elki" /&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>That puts canonical stuff in page header.</p>
  
  <p>How can I get the following URL:</p>
  
  <p><a href="http://concert.local/elki" rel="nofollow">http://concert.local/elki</a></p>
  
  <p>?</p>