Apache incorrectly displays the sites

Discussion in 'Installation/Configuration' started by kudos, Sep 16, 2013.

  1. kudos

    kudos New Member

    Hi All!

    I have a problem with my Apache 2.2.15, CentOS 6.4 and ISPconfig 3.0.5.3.
    I have two sites on my server: yyyy.com and zzzz.com.

    When I do url yyyy.com and www.yyyy.com opening site yyyy.com.
    When I do url zzzz.com opening site zzzz.com.
    But when I do url www.zzzz.com opening site yyyy.com.

    No redirect, no alias. All configurations files looks normal.
    I don't know what can be reason.
    I very much look forward to the experience of our community.

    Please, help me!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure that you either use * or the ip address for all sites. If you mix * and IP, then apache might fail to redirect requests to the corect site.
     
  3. kudos

    kudos New Member

    Dear Till Brehm,

    Thank you for the your message. I checked it: all the sites use same IP address (not *) and it corresponds to the configuration ISPconfig.

    In the file .htaccess of site zzzz.com there is a record:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.zzzz\.com$
    RewriteRule ^(.*)$ http://zzzz.com/$1 [L,R=301]

    But this record does not work.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you select auto subdomain www in website zzzz.com?
     
  5. kudos

    kudos New Member

    For the site zzzz.com Auto-Subdomain is none.
    I does deleted the records above from the file .htaccess. Result same.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Set it to www. You can not redirect a non existing subdomain in a .htaccess file in apache, so you have to add it e.g. as auto subdomain.
     
  7. kudos

    kudos New Member

    I see.

    I see.

    Thank you.
    But this not all what i want. Sites zzzz.com and yyyy.com configured similarly but yyyy.com openning differently. I wrote above.

    In any case, thank you very much for your help.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, and the reason is aboslutely clear and I explained you that above.

    You have 2 options:

    a) do nothing if you dont want it to get to work.
    b) solve the problem, I told you what you have to do for that and the reason why it happens.

    [edit]

    Maybe a short addition: yyyy.com is configured wrong as well if you had set auto subdomain to none, you just dont see it as all requests to non existing sites are redirected to the first site by apache. So if you want to configure your server 100% correct, then yu have to set auto subdomain to www there as well (which is the default of ispconfig btw, so you must have set it to none while you create the site).
     
    Last edited: Sep 17, 2013
  9. kudos

    kudos New Member

    Dear Till Brehm,

    You absolutely right! I selected auto subdomain www in website zzzz.com and edited file .htaccess. Now site zzzz.com work correct.

    Thank you very much.
     

Share This Page