title: create filter to ensure lowercase urls
body: <p>I have the following code in the global.asax of my mvc web application:</p>
  
  <pre><code>/// &lt;summary&gt;
      /// Handles the BeginRequest event of the Application control.
      /// &lt;/summary&gt;
      /// &lt;param name="sender"&gt;The source of the event.&lt;/param&gt;
      /// &lt;param name="e"&gt;The &lt;see cref="EventArgs" /&gt; instance containing the event data.&lt;/param&gt;
      protected void Application_BeginRequest(object sender, EventArgs e)
      {
          // ensure that all url's are of the lowercase nature for seo
          string url = Request.Url.ToString();
          if (Request.HttpMethod == "GET" &amp;&amp; Regex.Match(url, "[A-Z]").Success)
          {
              Response.RedirectPermanent(url.ToLower(CultureInfo.CurrentCulture), true);
          }
      }
  </code></pre>
  
  <p>What this achieves is to ensure all url's accessing the site are in lower case. I would like to follow the MVC pattern and move this to a filter that can applied globally to all filters. </p>
  
  <p>Is this the correct approach? And how would I create a filter for the above code?</p>