Domain Aliases

Discussion in 'ASP.NET 2.0' started by michaelw22, Jan 10, 2009.

  1. If I had a domain alias set up, could I redirect ie. do a 301 redirect in the web.config with something like this in the Application_BeginRequest event

    string host = new Uri(Context.Request.Url.ToString()).Host;
    if (host != 'www.site.com')
    {
    newURL = 'www.site.com';
    Context.Response.Clear();
    Context.Response.Status = '301 Moved Permanently';
    Context.Response.AddHeader('Location', newUrl);
    Context.Response.End();
    }

    Do you think there would be any issues with a domain alias?

    thnks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

Share This Page