void Application_BeginRequest(Object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
if (app != null)
if (app.Request.AppRelativeCurrentExecutionFilePath == "~/About.aspx")
app.Context.RewritePath(
app.Request.Url.PathAndQuery.Replace("/About.aspx", "")
);
}
I want to hide url like the following :
requested url : “http://domain.com/WebFolder/page.aspx”
url should be show : “http://domain.com/WebFolder”
The above code is not producing my desired result. It’s causing to redirect new rewrite page. I don’t want that, I just want to hide my url for section of page name.
You can use the IIS
URL Rewritemodule.