Redirecting SubDomain to a SubFolder

Discussion in 'ASP.NET / ASP.NET Core' started by azamsharp, Jul 19, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am reading the following article on redirecting sub-domain names to sub folders but where exactly should I put the code:

    https://support.discountasp.net/KB/a369/how-to-redirect-a-subdomain-to-a-subdirectory.aspx

    Here is my code in Default.aspx.cs file:

    protected void Page_Load(object sender, EventArgs e)
    {
    if((Request.ServerVariables["SERVER_NAME"].ToUpper()).IndexOf(("subdomain.highoncoding.com".ToUpper())) > 0)
    {
    Response.Redirect("/MySubFolder");
    }

    }
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page