Apache Redirect is redirecting all HTTP instead of just one subdomain

Posted by David Kaczynski on Server Fault See other posts from Server Fault or by David Kaczynski
Published on 2012-11-11T21:02:39Z Indexed on 2012/11/11 23:02 UTC
Read the original article Hit count: 228

Filed under:
|

All HTTP requests, such as http://example.com, are getting redirected to https://redmine.example.com, but I only want http://redmine.example.com to be redirected. For example, requests for

I have the following in my 000-default configuration:

<VirtualHost *:80>
        ServerName redmine.example.com
        DocumentRoot /usr/share/redmine/public

        Redirect permanent / https://redmine.example.com
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        .
        .
        .
</VirtualHost>

Here is my default-ssl configuration:

<VirtualHost *:443>
        ServerName redmine.example.com
        DocumentRoot /usr/share/redmine/public

        SSLEngine on
        SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

        BrowserMatch "MSIE [2-6]" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

        <Directory /usr/share/redmine/public>
                Options FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>

        LogLevel info
        ErrorLog /var/log/apache2/redmine-error.log
        CustomLog /var/log/apache2/redmine-access.log combined
</VirtualHost>

<VirtualHost *:443>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        .
        .
        .
</VirtualHost>

Is there anything here that is cause all HTTP requests to be redirected to https://redmine.example.com?

© Server Fault or respective owner

Related posts about apache2

Related posts about redirect