Hi I'm trying to setup the redirect for sub-domains as per the article at http://support.discountasp.net/KB/a...main-to-a-subdirectory.aspx?KBSearchID=290661 The example appears to be in classic Asp Can you provide me with a sample that will work in Asp.net C# and tell me where on the page I should place the code? Thanks Mark
Put it in your Page_Load method. C# if (((Request.ServerVariables["SERVER_NAME"].ToUpper().IndexOf("subdomain2.YourHostedDomainName.com".ToUpper()) + 1) > 0)) { Response.Redirect("/subdomain1"); } else if (((Request.ServerVariables["SERVER_NAME"].ToUpper().IndexOf("subdomain2.YourHostedDomainName.com".ToUpper()) + 1) > 0)) { Response.Redirect("/subdomain2"); } else if (((Request.ServerVariables["SERVER_NAME"].ToUpper().IndexOf("subdomain3.YourHostedDomainName.com".ToUpper()) + 1) > 0)) { Response.Redirect("/subdomain3/home.asp"); }