2 domain names -> 1 server -> 2 different websites


OSNN Veteran Addict
I am curious. I am using Apache 2 on a Windows XP Pro machine. Currently, I have a dyndns.org account, that redirects glaanieboy.dyndns.org to my home machine. What I want to know, is it possible to create another dyndns account (or any other redirecting service, such as freeddns) and have that domain redirect to the same server, but to another directory? Is this what Virtual Host stands for?
I hope I make sense here, if not, please say so.


OSNN Senior Addict
I know this is, for me, easier to do under IIS because you can just give one NIC mulitiple IP addresses and then point different domains in to different "IP's" however, this wouldn't work in your situation because I would figure you recieve your IP dynamically from your ISP (Which would explain the DYNDNS stuff you need). Sorry I cannot help you with this, I don't think it's possible because of your internet service.


OSNN Veteran Addict
Thanks blinden, though I am sure I have seen it somewhere. Somehow Apache must detect from which domain the server was accessed and provide the correct website. Am I right?


OSNN Veteran Addict
This is what I use on my apache server for name based virtual hosting

NameVirtualHost *

<VirtualHost *>
ServerAdmin admin@domain.com
DocumentRoot /path/to/html/documents/
ServerName second.domain.com
ServerAlias second
<Directory "/path/to/html/documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all


OSNN Veteran Addict
Hmm, didn't work quite like I wanted. As I said, I already had glaanieboy.dyndns.org redirected to my server, but when I added the other dyndns.org account I created as a VH, both domain names would redirect to the second website. So I added both sites as a VH:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName second.dyndns.org
ServerAlias second
DocumentRoot "C:/path/to/second/site"

<VirtualHost *:80>
ServerName first.dyndns.org
DocumentRoot "C:/path/to/first/site"
And that worked :)

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member