You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ravi <ra...@gmail.com> on 2008/03/01 15:09:14 UTC

[users@httpd] Help - Subdomains not working properly

I am trying to get two subdomains setup. I have copied the settings 
below. The problem is that all requests (even for second subdomain) are 
being served by first subdomain. e.g. if I type in a URL 
http://mydomain.com, the file served is from "C:/mydomain/test" and not 
from "C:/mydomain/www" as I would expect.

Please help. What am I doing wrong?


My hosts file has these entries:
************************************************
127.0.0.1       mydomain.com
127.0.0.1       test.mydomain.com
************************************************


My httpd.conf file has these entries:
************************************************
NameVirtualHost *

<Directory "C:/mydomain/test">
     Options None
     Order allow,deny
     Allow from all
</Directory>
<VirtualHost *>
	ServerName test.mydomain.com
	DocumentRoot C:/mydomain/test
</VirtualHost>


<Directory "C:/mydomain/www">
     Options None
     Order allow,deny
     Allow from all
</Directory>

<VirtualHost *>
	ServerName www.mydomain.com
	DocumentRoot C:/mydomain/www

</VirtualHost>
************************************************


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Help - Subdomains not working properly

Posted by Krist van Besien <kr...@gmail.com>.
On Sat, Mar 1, 2008 at 3:09 PM, Ravi <ra...@gmail.com> wrote:
>
>  I am trying to get two subdomains setup. I have copied the settings
>  below. The problem is that all requests (even for second subdomain) are
>  being served by first subdomain. e.g. if I type in a URL
>  http://mydomain.com, the file served is from "C:/mydomain/test" and not
>  from "C:/mydomain/www" as I would expect.
>
>  Please help. What am I doing wrong?

You have two virtual hosts defined:

www.mydomain.com
and
test.mydomain.com

You request however pages from:
mydomain.com

Since you did not define a virtualhost for mydomain.com apache just
serves you the content from the first virtualhost defined.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org