#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Ft Myers FL
    Posts
    14
    Rep Power
    0

    2 domains, one site


    I'm trying to do a small scale multi tenant website project for my own education. I just want two domains
    pointing to one single website. The first step I'm trying to figure out is how to get second domain to point to the site.
    I've searched and all I found was stuff about how to redirect a domain but thats not what I want.

    I need both domains to keep their unique name and not just have them revert to the main domain name.

    Anyone feel like helping me figure this out or even point me to a tutorial that you know of that will work too.


    Thanks in advance!!!!
  2. #2
  3. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,101
    Rep Power
    4103
    Just have both domains resolve to the same IP address. Then configure your web server software to respond to both domains.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Ft Myers FL
    Posts
    14
    Rep Power
    0
    Thanks, I have them set to the same IP but as for the other half of what you said, I have no clue how to do that. Could you point me in the direction of some tutorials or anything that pertains to this? I'm just coming up empty on my searches.
  6. #4
  7. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,396
    Rep Power
    9645
    Do you have one site set up? For Apache and nginx all you have to do is add another domain name to the site configuration. For IIS it's probably also something simple. Then just make sure you aren't doing any sort of domain name-based redirections, which for you is probably already the case.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Ft Myers FL
    Posts
    14
    Rep Power
    0
    Yeah I have a site up and running. I use to HostGator to host it and for the secondary domain I own I set it to my main site IP address. Thats as far as I got. The site configuration you speak of is using the command prompt (for windows anyway) yeah?
  10. #6
  11. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,396
    Rep Power
    9645
    When you set up the site on HostGator, what did you do? Do you have a place where you can add a new site? It'll ask for a domain name and maybe a place to put the files for it - you'd use the same place that the other site is using.

    Originally Posted by bob8619
    The site configuration you speak of is using the command prompt (for windows anyway) yeah?
    Not at all.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Ft Myers FL
    Posts
    14
    Rep Power
    0
    Thank you, got it to work. But I actually deleted where I entered the IP address so all I have is the secondary domain set as an Add on domain and I set the directory root to the same file path as the actual site. Is this alright?

    So If I build a multi tenant webapp and end up with say, 30 clients, will I add their domains the same way? I had been told elsewhere that I need to use virtual hosts or nginx reverse proxy to link multiple domains to one site so I'm a little confused by that.
  14. #8
  15. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,396
    Rep Power
    9645
    Originally Posted by bob8619
    Thank you, got it to work. But I actually deleted where I entered the IP address so all I have is the secondary domain set as an Add on domain and I set the directory root to the same file path as the actual site. Is this alright?
    It sounds like it wouldn't work, but if it does then it does.

    Originally Posted by bob8619
    So If I build a multi tenant webapp and end up with say, 30 clients, will I add their domains the same way?
    That's when you should start caring about setting this sort of stuff up yourself.

    Originally Posted by bob8619
    I had been told elsewhere that I need to use virtual hosts or nginx reverse proxy to link multiple domains to one site so I'm a little confused by that.
    That's what HostGator is doing for you.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Ft Myers FL
    Posts
    14
    Rep Power
    0
    Originally Posted by requinix
    That's when you should start caring about setting this sort of stuff up yourself.
    Thats been the goal from the beginning but I can't just will the knowledge into my own mind I have to learn from somewhere. Admittedly it took me way too long to find the solution as it was just hiding in plain site. I guess
    I was sent on a goose chase when I was told I needed to deal with setting up the reverse proxy and what not.

    But I would still like to know if the method I used is suitable for a large amount of domains or if one typically has a different approach?
  18. #10
  19. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,396
    Rep Power
    9645
    That's how very many websites work. Especially something using shared hosting - which is basically what you're doing.
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Ft Myers FL
    Posts
    14
    Rep Power
    0
    Great! Thanks for your help!

IMN logo majestic logo threadwatch logo seochat tools logo