I have now come up with a solution to this issue. 1&1 windows hosting (the package I am on) does not seem to allow the usual rewrite solution in the web.config which made things difficult but as it turns out not at all impossible. After much head scratching and not looking at things like a C# dev I finally put my C# cap back on and realised the solution. I simply wrote the code below in the codebehind of my master page (as I wanted it to propogate through all pages) and it now performs the redirect correctly as shown on 301-redirect-checker
protected void Page_Load(object sender, EventArgs e)
{
// Permanently 301 Redirect .co.uk to .com
if (Context.Request.Url.AbsoluteUri.ToUpper().Contains("MYSITE.CO.UK"))
{
Context.Response.Status = "301 Moved Permanently";
Context.Response.AddHeader("Location", "http://www.mysite.com" + Context.Request.Url.AbsolutePath);
if (Request.Url.AbsolutePath.ToUpper() == "/DEFAULT.ASPX")
{
Response.AddHeader("Location", "http://www.mysite.com");
Context.Response.RedirectPermanent("http://www.mysite.com");
}
else
{
Context.Response.AddHeader("Location", "http://www.mysite.com" + Context.Request.Url.AbsolutePath);
Context.Response.RedirectPermanent("http://www.mysite.com" + Context.Request.Url.AbsolutePath);
}
}
}