The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Catch all for subdomains?

Discussion in 'General Discussion' started by Arp_Hiemstra, Jan 25, 2006.

  1. Arp_Hiemstra

    Arp_Hiemstra Member

    Joined:
    Dec 24, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    Is there any way to have a catch all for subdomains?

    If a user goes to www.domain.com or mail.domain.com it should really go there only if a none existend domain is used like weekend.domain.com then it should go to www.domain.com is it possible to set this up somewhere?

    Thanks,

    Arp
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Add in the DNS zone file of the domain.com :

    * 14400 IN A 11.22.33.44

    (NOTE: 11.22.33.44 should be the IP of the domain.com)

    OPen /usr/local/apache/conf/httpd.conf

    search for the domain.com and in its <Virtual Host> section add the follwoing line

    ServerAlias *.domain.com

    Save httpd.conf, restart apache....That's all
     
  3. Arp_Hiemstra

    Arp_Hiemstra Member

    Joined:
    Dec 24, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Ok that works but how to enable the subdomains i do want.

    Thanks for the info about *.domain.com this does work. Only problem is that it really catches all subdomains even the ones i do want to exist.

    Is there any way to catch only the subdomains that do not exist and leave the ones that do exist to work correct?

    Thanks
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Just put the wildcard entry after the real ones.
     
Loading...

Share This Page