multiple site with sub domains issues

Discussion in 'Installation/Configuration' started by jtullous, Jun 21, 2010.

  1. jtullous

    jtullous New Member

    Ok I got sub domain website to work but having an issue with no subdomain websites showing up at as subdomain websites.

    for example:

    one domain named example.com it has 2 websites:

    www.example.com and sub.example.com

    when looking up the site that works completely fine. But if you do a look up on just:

    http://example.com it pulls up the http://sub.example.com site.

    What is even more odd is there is 2 more site that are setup as:

    www.example2.com and www.example3.com which are 2 other domains also.

    If you do a lookup with out the www if front of the domain address you get the sub.example.com site.

    Each site does have the Auto-Subdomain set to none. And each domain just has the an A record to www and IP.

    I have also noticed that when you do not use the www but just the example.com as it does pull up the site and domain that is sub.example.com it seems to be masking the site with it own domain.

    Any suggestions?

    What the out come should be is that it should shows a 404 page that its not found. Not another website on another domain.
     
    Last edited: Jun 21, 2010
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    And thats the problem. You missed to enable auto subdomain www for the site example.com that shall be also www.example.com
     
  3. jtullous

    jtullous New Member

    Thanks ok that seemed to work. No more redirect to the sub.example.com site.

    But one other thing since I have enabled the auto-subdomain, when someone hits the example.com it doesnt redirect to the www.example.com its just a 404 which is ok but if I wanted http://example.com redirect to http://www.example.com where do i set that up and how?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You create a website example.com where you enable auto subdomain www and not a website www.example.com. you do not enable any kind of redirects.
     
  5. jtullous

    jtullous New Member

    Understand,

    If an A record of www is set will that confused the auto sub domain of www?

    Or do they play hand in hand?

    They way it is setup atm is:

    dns:
    Arecords
    www -> ip
    sub -> ip

    Website is setup as:

    example.com with auto-sub domain set to www.


    Now when searching for http://example.com you get search engine result looking for the site.

    If you type www.example you get the page. My understanding is that if the auto-sub domain is set to www the resquest of example.com should pull up www.example.com correct?

    The site doesnt answer to example.com but will answer to a www.example.com

    Maybe I am just confused on the records since this is new field I have taken on.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You mix up the website and dns here. Your problem is not related to the site settings, you missed is to add a dns A-Record for example.com pointing to the IP address of the server. How shall your webbrowser know which server to contact if there is no dns record for it?
     
  7. jtullous

    jtullous New Member

    Ahh the infamous wildcard. Thank you.

    I did do the following and added:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www
    RewriteRule (.*) http://www.%{HTTP_HOST}$1 [L,R]

    Only on the sites I wanted the www to show.

    So far so good.
     

Share This Page