In your global.asax file add the following code (edit bold areas):
<script language="C#" runat="server">// This code is free as long as this line stays in tact. ©Code Shawn Hyde http://shawnhyde.comprotected void Application_BeginRequest(Object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("http://olddomain.tld")) { HttpContext.Current.Response.Status = "301 Moved Permanently"; HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower().Replace("http://olddomain.tld","http://newdomain.tld")); } }</script>