Request.URL.Host

Discussion in 'ASP.NET 2.0' started by bsaini, Oct 11, 2007.

  1. Hi there,

    My Host URL is http://domain.com. However, the C# method Request.URL.Host returns http://domain.web125.discountasp.net.

    How can I programmatically get http://domain.com?

    Btw - any idea why the "www." is missing from the URL? The discountasp admins say that I'm redirecting from http://www.domain.com to http://domain.com. However, I don't see this in my code. Then again, I'm using Community Server as the backbone of my web application soI'm not sure if this is redirecting from somewhere deep within the code.

    Thanks in advance!
     
  2. Use something like Request.Url.ToString() and split it with '/' .See if this helps!

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. You probably installed the Community Server application using http://domain.com. So that's the site URL that got recorded in the database.You should be able to change this either within the Community Server admin or in the database directly.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page