Forum Moderators: phranque
I have enabled wildcards on DynDns, and set it all up in apache, however, no matter what I type as a sub-subdomain, it always returns the main page.
This is how I have my httpd.conf setup:
NameVirtualHost *:80
#Main Host
<VirtualHost *:80>
DocumentRoot "K:/WebRoot/"
ServerName "myhost.example.org"
</VirtualHost>
#Secondary Host
<VirtualHost *:80>
DocumentRoot "K:/WebRoot/subdomain/"
ServerName "subdomain.myhost.example.org"
</VirtualHost>
Any clues?
[edited by: jdMorgan at 7:48 pm (utc) on Jan. 11, 2006]
[edit reason] Obscured domain per TOS. [/edit]
To add subdomain.localhost to your apache httpd.conf you need to take the following steps:
1) set httpd.conf with:
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot C:\server\apache\htdocs\site
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>
<VirtualHost 127.0.0.2>
ServerName subdomain.localhost
DocumentRoot C:\server\apache\htdocs\site\subdomain
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>
save and exit
2) edit C:\windows\system32\drivers\etc\hosts (using a text editor) and add the line
127.0.0.2 subdomain subdomain.localhost
after the 127.0.0.1 line. Save and exit.
restart apache. Go to subdomain.localhost and find the correct content there.
If so, see Windows knowledge base article, "Programs that connect to IP addresses in the loopback address range may not work as expected [microsoft.com]."
Jim