robw
By:
robw

Apache HTTPS site DISabled, but still being redirected to it at the www (non-www works)

December 2, 2014 1.1k views

This isn't the most beautiful VirtualHost, but I've tried just about everything else. I moved one HTTPS domain to another HTTPS domain (same IP), and want to send all traffic to the old domain to the HTTP site. When I run curl -I example.com and curl -I www.example.com I get the same response, but when I go to the websites in any browser, I'm prompted with a "Your connection is not private" error message.

<VirtualHost *:80>
  ServerAdmin web@my-website.com
  ServerName www.my-website.com

  <Directory /home/my-website/old>
    AllowOverride all
    Options -MultiViews
   </Directory>

   DocumentRoot    /home/my-website/old/
   ErrorLog        /home/my-website/shared/log/error.log
   CustomLog       /home/my-website/shared/log/access.log combined
</VirtualHost>

<VirtualHost *:80>
  ServerAdmin web@my-website.com
  ServerName my-website.com

  <Directory /home/my-website/old>
    AllowOverride all
    Options -MultiViews
   </Directory>

   DocumentRoot    /home/my-website/old/
   ErrorLog        /home/my-website/shared/log/error.log
   CustomLog       /home/my-website/shared/log/access.log combined
</VirtualHost>

I feel like this might be a DNS cache issue somewhere along the lines, but I don't know how to debug that or confirm my suspicion.

1 Answer

If you had issued a Strict-Transport-Security header at some point your browser saves this information and will reject connecting over plain HTTP in the future, try clearing all browser data.

Have another answer? Share your knowledge.