title: ASP.NET: How to rewrite URL after slash
body: <p>I have a website that has language options of which one is turkish (tr). </p>
  
  <p>The problem is that I deleted the language in the website (end user can no longer check the site in turkish) BUT the links can still be consulted via Google. </p>
  
  <p>An example link looks like: <a href="http://example.com/page2.aspx?lang=tr" rel="nofollow noreferrer">http://example.com/page2.aspx?lang=tr</a> .</p>
  
  <p>What I want to do to solve this, is to redirect all requests to <code>?lang=tr</code> to my homepage (<a href="http://example.com" rel="nofollow noreferrer">http://example.com</a>). </p>
  
  <p>Is this achievable via URL rewriting? How would I do this? </p>
  
  <p>I have checked it in rewrite module but didn't came further than this: </p>
  
  <pre><code>  &lt;rewrite&gt;
              &lt;rules&gt;
                  &lt;rule name="Test" patternSyntax="Wildcard"&gt;
                      &lt;match url="?lang=tr" ignoreCase="true" /&gt;
                      &lt;action type="Redirect" url="{R:1}?lang=en" appendQueryString="false" /&gt;
                      &lt;conditions logicalGrouping="MatchAny"&gt;
                      &lt;/conditions&gt;
                  &lt;/rule&gt;
              &lt;/rules&gt;
          &lt;/rewrite&gt;
  </code></pre>