I can usually do the translation myself, but this time I am a bit stumped
Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder.
class UrlRewriteModule : IHttpModule
public void Dispose()
// Nothing to dispose
public void Init(HttpApplication context)
context.BeginRequest += new EventHandler(context_BeginRequest);
void context_BeginRequest(object sender, EventArgs e)
HttpContext context = HttpContext.Current;
if (context.Request.QueryString["Rewritten"] != null)
// Select the original url from database
else if (context.Request.HttpMethod == "GET")
// Select the rewritten url from database and redirect to that page with a querystring
// or other identifier (like "?Rewritten=yes")
context.Response.Redirect(rewrittenUrl + "?Rewritten=yes");
// Other codes if needed
Hope this works for you.
Convert C# to VB.Net
Convert VB.Net to C#
I have used this site with good results.
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.