Thank you for your reply.
I tried with the following code for the url rewriting.
public class UrlRewriting : IHttpModule
public void Init(System.Web.HttpApplication MyApp)
MyApp.BeginRequest += new System.EventHandler(Rewriting_BeginRequest);
public void Rewriting_BeginRequest(object sender, System.EventArgs args)
HttpApplication inst = sender as HttpApplication;
string req_path = inst.Context.Request.Path.ToLower();
if (req_path.IndexOf("/sitefinity/") < 0)
if (inst.Context.Request.CurrentExecutionFilePathExtension == ".aspx")
if (req_path.IndexOf(".aspx") > 0)
req_path = req_path.Replace(".aspx", "");
public void Dispose()
I was trying to put it under App_Code folder as a .cs file(rewrite.cs), not sure whether this folder is disabled in latest sitefinity 5.0. If yes, is there any better place where I can place this code?
Also , one more disadvantage I found is that, if the user types in www.mysite.com/aboutus.aspx
in the url box of the browser, it is coming as www.mysite.com/aboutus
It is actually doing a response.redirect . If it was server.transfer(new url), the url in the url box will be same(but unfortunately server.transfer doesn't work here). any ideas?