Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1727

Apache2: While redirecting 2nd website http to https, it always rewdirects to 1st domain

$
0
0

All my Vhost config files have a <virtualhost *:443> and a <virtualhost *:80> in each. There is no default host declared. Apache2 is selecting my vhost #1 as a default. Vhost #1 is now working as expected with any request addressed to http:// gets rerouted to https://www.vhost-1. I am now trying to set up vhost-2 to do the same thing but no matter what I do, a request sent to http://vhost-2.com will always end up at http://www.vhost-1. There is nothing in any of the logs that indicate any kind of error but logs do show that https://www.vhost-2.com is being accessed. I am assuming that it then gets rerouted again to https://www.vhost-1. I removed all but sleepyvalley and ancienttom config files from sites-enabled. I see nothing in any other file triggering a second redirect, either directly to vhost-1 or to it as the default website. I have been working all day searching through all of my config files for any possible entries that may be causing this without any success.

Vhost-1

<VirtualHost *:443>    ServerAdmin webmaster@sleepyvalley.net    SSLEngine on    SSLCertificateFile /etc/ssl/certs/sleepyvalley.crt    SSLCertificateKeyFile //etc/ssl/private/sleepyvalley.key    ServerName www.ancienttom.com    ServerAlias ancienttom.com ancienttom.us www.ancienttom.us    DocumentRoot /var/www/html/ancienttom<Directory /var/www/html/ancienttom>        Options Indexes FollowSymLinks MultiViews        AllowOverride All        DirectoryIndex index.html index.htm index.php index.php5        Order allow,deny        allow from all</Directory></VirtualHost><VirtualHost *:80>    ServerName ancienttom.com    Serveralias www.ancienttom.com ancienttom.us www.ancienttom.us    Redirect permanent / https://www.ancienttom.com/</VirtualHost>

vhost-2<VirtualHost *:443>ServerAdmin webmaster@sleepyvalley.net

    SSLEngine on    SSLCertificateFile /etc/ssl/certs/sleepyvalley.crt    SSLCertificateKeyFile //etc/ssl/private/sleepyvalley.key    ServerName www.ancienttom.com    ServerAlias ancienttom.com ancienttom.us www.ancienttom.us    DocumentRoot /var/www/html/ancienttom<Directory /var/www/html/ancienttom>        Options Indexes FollowSymLinks MultiViews        AllowOverride All        DirectoryIndex index.html index.htm index.php index.php5        Order allow,deny        allow from all</Directory></VirtualHost><VirtualHost *:80>    ServerName ancienttom.com    Serveralias www.ancienttom.com ancienttom.us www.ancienttom.us    Redirect permanent / https://www.ancienttom.com/</VirtualHost>

Viewing all articles
Browse latest Browse all 1727

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>