Apache virtualhost

Discussion in 'Server Operation' started by Alme5, May 31, 2018.

  1. Alme5

    Alme5 New Member

    I followed your Centos 7 LAMP guide and now I have a nice website running there. I already had a mailserver running with squirrelmail. The hostname is: mail.website.com
    On the same server I also have another subdomain - chat.website.com already running and the vhost configured to redirect the traffic to /var/www/html/chat.website.com
    Originally I had the following in /etc/httpd/conf/httpd.conf
    Alias /webmail /usr/share/squirrelmail
    <Directory /usr/share/squirrelmail>
    Options Indexes FollowSymLinks
    RewriteEngine On
    AllowOverride All
    DirectoryIndex index.php
    Order allow,deny
    Allow from all

    This works ok and every time I visit mail.website.com/webmail I get redirected to squirrelmail. The problem is that I also get redirected to squirrelmail when I visit chat.example.com/webmail and this is something I dont want to happen.
    What I would prefer is that when users visit mail.example.com they should be redirected to squirrelmail and when they visit chat.website.com to /var/www/html/chat.website.com
    Any help how I can get mail.explample.com to work the way I intend? Thanks
  2. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    think... if you define an Alias globally ... it be active for every call.
    If you move that from your httpd.conf to the <Virtualhost> block you want this alias to work ... shouldn't be too complicated :)

Share This Page