need companyname.com to resolve to www.companyname.com

Discussion in 'Hosting Services / Control Panel' started by Webs, Nov 30, 2006.

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

    My client has requested that when a person types in companyname.com, the URL will resolve to www.companyname.comand display that way in the address bar.

    Is there an easy way to do this? Many thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Nothing can be done on the server side, gotta do this programatically.


    You familiar w/ ASP or ASP.NET?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Yes, I am familiar with ASP.
    Any ideas?
     
  4. PRB

    PRB

    This might work, this should be the very firstpiece of codein your default page.

    <%
    sname = Request.ServerVariables("SERVER_NAME")
    sname = ucase(sname)
    if InStr(sname,"COMPANYNAME.COM") <> 0 then
    response.redirect "www.companyname.com"
    else
    response.redirect "default.aspx"
    end if
    %>

    Modify variables in red
     
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