0

I'm trying to have 3 different domains on my VPS, those are

pd.lsgob.us
intranet.lsgob.us 
lsgob.us

I have configured them but for some reason I'm getting redirected to the same index.html that the one in lsgob.us

intranet.lsgob.us

https://i.stack.imgur.com/0Wwxz.png

lsgob.us

https://i.stack.imgur.com/9KHFW.png

Virtualhost intranet

<VirtualHost *:80>

    ServerAdmin soporte@lsgob.us
    ServerName intranet.lsgob.us
    ServerAlias www.intranet.lsgob.us
    DocumentRoot "/var/www/intranet/"

    <Directory "/var/www/intranet/">

            Options Indexes FollowSymLinks
            AllowOverride all
            Require all granted

    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.intranet.lsgob.us [OR]
    RewriteCond %{SERVER_NAME} =intranet.lsgob.us
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Virtualhost lsgob

<VirtualHost *:80>

    ServerAdmin soporte@lsgob.us
    ServerName lsgob.us
    ServerAlias www.lsgob.us
    DocumentRoot /var/www/lsgob

    <Directory /var/www/lsgob>

            Options Indexes FollowSymLinks
            AllowOverride all
            Require all granted

    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.lsgob.us [OR]
    RewriteCond %{SERVER_NAME} =lsgob.us
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

1 Answers1

1

Both of these virtualhosts makes a redirect to HTTPS:

RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

Therefore, it doesn't matter what's in their DocumentRoot. Instead, you should check the corresponding <VirtualHost *:443> configuration blocks: that they exists and are configured with different DocumentRoots.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122