Avatar of up-tech
 asked on

Apache and HTTPS Odd Behavoir

I have quite a few vhost configurations on my servers, but lets take two for example:

site1.example.com and site2.example.com.

Site 1 vhost:

<VirtualHost *:80>
        ServerName  site1.example.com
        ServerAlias site1.example.com

Open in new window

Site 2 vhost:
NameVirtualHost *:80
<VirtualHost *:80>
        ServerName site2.example.com
        ServerAlias site2.example.com
        Redirect permanent / https://site2.example.com/

<VirtualHost *:443>
        ServerName  site2.example.com
        ServerAlias site2.example.com

Open in new window

The odd thing is, if I go to https://site1.example.com the server responds using the vhost conf and certificate of the site2 ssl configuration, any ideas?
Apache Web ServerSSL / HTTPS

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
Dave Baldwin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Naranthiran D

Did you clear your browser history or cache and try..

Thanks Dave.
Dave Baldwin

You're welcome.
Your help has saved me hundreds of hours of internet surfing.