CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    May 2006
    Posts
    306

    [RESOLVED] Apache Sub-Domain

    Ok, first, what is this?

    [_] Create wildcard alias for "*.host.domain.tld"
    Secondly, I have it working at new.iggyhopper.dyndns.org, but it serves from the same directory as my main domain.

    Here is my config code.
    Code:
    <VirtualHost new.iggyhopper.dyndns.org:80>
        ServerName new.iggyhopper.dyndns.org:80
        ServerAdmin [email protected]
        DirectoryIndex index.htm index.php
    DocumentRoot "C:\Server\Main"
    <Directory "C:/Server/Main">
        Order allow,deny
        Allow from all
        AllowOverride All
        AddType application/x-httpd-php php php4 php3 html htm
    </Directory>
    </VirtualHost>
    Can anyone tell me what is wrong?

    EDIT:

    You can't have just one normal normal, and one name-based virtual host. You have to have both your domain, and sub domain, on a vHost. Here's my code.

    Code:
    NameVirtualHost *:80
    
    <VirtualHost *:80>
        ServerName iggyhopper.dyndns.org
        #ServerAdmin !@#$
        DirectoryIndex index.htm index.php
        AddType application/x-httpd-php php php4 php3 html htm js
        DocumentRoot "C:/Server/172.16.1.35"
        <Directory "C:/Server/172.16.1.35">
            Order allow,deny
            Allow from all
            AllowOverride All
        </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerName new.iggyhopper.dyndns.org
        #ServerAdmin !@#$
        DirectoryIndex index.htm index.php
        AddType application/x-httpd-php php php4 php3 html htm js
        DocumentRoot "C:\Server\Main"
        <Directory "C:/Server/Main">
            Order allow,deny
            Allow from all
            AllowOverride All
        </Directory>
    </VirtualHost>
    There you go.
    Last edited by code?; May 15th, 2009 at 12:59 PM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured