Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post

    domain.com REDIRECTS TO www.

    Hello...

    Now, I am not on Windows 2000 Server and I am unable to create more then one website with host headers. (IIS 5.0)

    Now, my problem is, if a person types in http://domain.com I want it to redirect it to http://www.domain.com

    Example sites:
    http://google.com REDIRECTS TO www.
    http://yahoo.com REDIRECTS TO www.
    http://real.com REDIRECTS TO www.
    Plus many others which I am sure you can find, now.

    Now I don't know exactly how this done, and I have 2 methods that seem like the only way I know...

    One is to set up a include page that is included on all of my pages (already have one for config reasons; Easier to edit my site and such) and have it check my site's "Server_Name" or "Http_Host" with ASP and requesting the server variable (ASP). It will check to see if www.domain is there, if not then it will redricted it to www.domain & What ever the rest of the info is. Either just .net or .net/page.asp.

    The other is to set up a virtual site with Windows 2000 Server that uses host headers and if typed in domain.com it will send it to www.domain.com with the idea of number one.


    Does anyone have a clue what I am talking about, and/or will be able to help me find the real method or what not?

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why redirect...?

    Just DON'T redirect.

    The default action *should* be that, if you don't redirect, "all roads lead to Rome" lol, i.e. everything goes to the same place.

    At least, that's what BIND does on a *nix box.

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #3
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    It's not a redirect that I want...

    I am just trying to find a way to do this exactly, so redirecting is not the way I really want to do it...

    This is possible a full Web server issue and has nothing to do with my DNS, but I am not sure about that, anyone know if I can do this with my DNS?

    I am at a full loss for this issue except for my two method above...

  • #4
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Its tough without running server.

    Try opening the HOSTS file under \winnt\system32\drivers\etc

    Then enter in:

    <your IP Address> www.domain.com

    There should be some comments in it about how to use the file and such. Give that a try.

    It might not work unless thats in the computer the persons viewing from... I forget its been awhile... If that doesn't work you'll need to configure it through your DNS server.
    Last edited by oracleguy; 03-20-2003 at 12:54 AM.
    OracleGuy

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that's not what hosts is for...

    I don't know how to do it in windows, only linux, but you may learn something from this, I don't know:

    http://www.tldp.org/HOWTO/DNS-HOWTO.html#toc7

    Yup it's for BIND but hey, the theory is that same

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #6
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    It's odd how you know so much oracleguy...

    I will look at this.. But hum.. I don't get it.

    This will allow people to do what exactly?
    Please explain more.

  • #7
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Originally posted by krycek
    that's not what hosts is for...

    I don't know how to do it in windows, only linux, but you may learn something from this, I don't know:

    http://www.tldp.org/HOWTO/DNS-HOWTO.html#toc7

    Yup it's for BIND but hey, the theory is that same

    ::] krycek [::
    I don't get it..
    What is this?

  • #8
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, first about hosts. hosts is simply a file that tells which IPs to look at when you type in a URL. For instance, if you are changing DNS then you might want to force redirect to the new IP using the hosts file. It only applies to your own PC.

    Second, the link I gave explains how DNS works. It's where I learn most of what I know about DNS. It's aimed at BIND but there should be something you can learn from it - surely Windows DNS can't be too different...? Until someone who has experience of DNS on Windows can help you, it's the best you've got...

    Thirdly, remember, "Google is your friend!"

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #9
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Well, I am not running my own DNS, I just use one... So I don't need to know any more about DNS then I should know for using one with text boxes and a submit button.

  • #10
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah. In that case, how do you expect us to help you??? ask whoever manages your DNS!

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #11
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Well, I first off, I think it's more of a webserver problem..
    So... I figured I would ask about it here...

  • #12
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, you should be able to do redirects however I don't see the point when it should be set up in your DNS.

    But, simply create a webpage that will immediately refresh to the desired location. Simple?

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #13
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Originally posted by Morgoth
    Well, I first off, I think it's more of a webserver problem..
    So... I figured I would ask about it here...
    No its a DNS problem. And krycek, yeah I was unsure I thought HOSTS only applied to the local computer but was not sure.

    Doesn't InterNic handle the DNS stuff as far as aren't they like the internet's DNS server basically? They translate domain.com into an IP address, right?

    Since you say you don't have your own DNS server, I'd call up ask the people that are doing your DNS like krycek suggested. Because as you probably know, "www" is a host header and it needs to be registered in the DNS.
    OracleGuy

  • #14
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    www is set as a CNAME towards my A recond of domain.com

    So I need to some how direct domain.com to automatically change to www.domain.com

    I don't know any other way then the two ways I suggested above.

    Does anyone know other methods?

  • #15
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Morgoth, I'm still not sure what you want to do! The way you describe, they should both go to the same place???

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •