protected void Application_BeginRequest(Object sender
string strCurrentPath;
strCurrentPath = Request
//make sure that it ends with aspx
//This will shortcut processing for images and other files (WebResource
if(System
string strCustomPath;
string qString = Request
if(qString != string
qString =
strCurrentPath = strCurrentPath
string appRoot = GetAppRoot(strCurrentPath);
//string pageName =
// the URL contains this folder name
//Response
if(strCurrentPath
appRoot = appRoot
strCustomPath = appRoot +
// rewrite the URL
Context
}
else if(strCurrentPath
appRoot = appRoot
strCustomPath = appRoot +
// rewrite the URL
Context
}
}
}
From:http://tw.wingwit.com/Article/program/net/201311/13825.html