title: Removing .aspx extension from sitecore in ExecuteRequest pipeline
body: <p>Currently I am trying to remove .aspx extensions from sitecore URL's. A blog suggests that changing the following would fix this issue:</p>
  
  <pre><code>&lt;add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="true"
  </code></pre>
  
  <p>The problem is that this does not work for all code in our websites as some custom controls force the usage of .aspx.</p>
  
  <p>What I was thinking is that if I can get into the pipeline before a response is sent back to the user I could change the URL to one that is more SEO friendly (no .aspx), I am trying to do this using the following code</p>
  
  <pre><code>public class CustomExecuteRequest : Sitecore.Pipelines.HttpRequest.ExecuteRequest
  {
      protected override void PerformRedirect(string url)
      {
          base.PerformRedirect(url.Replace(".aspx" , ""));
      }
  
      public override void Process(Sitecore.Pipelines.HttpRequest.HttpRequestArgs args)
      {
          PerformRedirect(args.Url.FilePathWithQueryString.Replace(".aspx", ""));
  
          //args.Url.FilePathWithQueryString = args.Url.FilePathWithQueryString.Replace(".aspx", "");
  
          //base.Process(args);
      }
  }
  </code></pre>
  
  <p>The code is being hit and this solution works, however it is performing a redirect which is really not what I want to do, I would rather just have a regular request with the URL cleaned up. The problem is that the args variable has a read-only field (commented out below) that is used to actually create the URL.</p>
  
  <p>Does anyone have any ideas as to how I can change the URL here, or perhaps somewhere else in the pipeline?</p>