This is probably the easiest way to search for friend URLs on the internet today.
Only two steps are required.
1. Add the following to global. asax:
Void application_beginrequest (Object sender, eventargs E)
{
String strcurrentpath;
String strbasepath;
String strcustompath;
Strcurrentpath = request. apprelativecurrentexecutionfilepath. substring (2). tolower ();
Strbasepath = request. applicationpath;
If (strcurrentpath! = String. Empty &&! Strcurrentpath. Contains ("."))
{
Strcustompath = strbasepath + "/load. aspx? Page = "+ strcurrentpath;
// Rewrite the URL
Context. rewritepath (strcustompath );
}
Else if (strcurrentpath = string. Empty)
{
Context. rewritepath (strbasepath + "/default. aspx"); // by default
}
Else
{
Context. rewritepath (strbasepath + "/" + strcurrentpath );
}
}
2.iis application configuration adds application mapping to extension: * executable path: The same as aps.net. This prevents IIS from reporting errors 404. All things are solved by Asp.net. Next, you can write the content of load. aspx.