title: Best strategy to append a querystring parameter to URL in C#
body: <p>I have got an ASP.NET C# website that serves content in several languages (English, French etc) through Localize tags and resx files. </p>
  
  <p>The information about the user language is currently stored into a Session object and nothing is visualized in querystring.
  I realized anyway that this structure prevents search engine to reference pages in other languages than English (the default one). In fact there is no link differentiation between pages in different languages.</p>
  
  <p>In order to overcome the problem I considered the chance of appending a querystring paramenter (ie: "lang=fr-FR") to set the state of pages Localization. This parameter should appear in each and every page of the website automatically. This way the links would be differentiated and the search engines would be able to 'see' pages in all the avalable languages.</p>
  
  <p>I tried to achieve this adding a global.asax to the project and working on the Application_BeginRequest event. I don't get any error but the parameter is simply not added to my pages. Here is the very basic core of my code:</p>
  
  <pre><code>  protected void Application_BeginRequest(object sender, EventArgs e)
      {
      Context.RewritePath("news.aspx?lang=FR",true); 
      }
  </code></pre>
  
  <p>Of course this is just a way of test the rewriting, not the production code; I would expect all pages (ie: index.aspx) to be be renamed 'news.aspx?lang=FR' on the browser. This alas does not happen; nothing changes in the URL of pages (not even in news.aspx).</p>
  
  <p>I verified that the Application_BeginRequest event of the global.asax is correctly triggered.</p>
  
  <p>Are you aware of a solution for this problem or could you suggest a better strategy to add a parameter in querystring in my scenario ?</p>
  
  <p>Thank you in advance.</p>