After enabling HTTPS on my Apache2 server - I get 404 errors on every request

Is it absolutely necessary to redirect all http requests to https? Cause it seems that's what you're trying to do here.

I suggest you start by removing the following lines from your conf:

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]

I suspect the syntax may be wrong there. Then try connecting again on each http:// and https:// protocols.


I can't exactly remember how I figured it out, but I stumbled across something somewhere that suggested to put:

<VirtualHost _default_:443>

Instead of:

<VirtualHost *:443>

Since replacing that, my SSL has been working perfectly.


Try editing your file to look something like this:

This is a very basic conf, if this works add your redirects if still needed.

If this does not work please show your ssl.conf

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
         <Directory "[docRoot]">
        AllowOverride All
        </Directory>
        DocumentRoot [docRoot]
        ServerName [serverName]
</VirtualHost>

<VirtualHost *:443>
        SSLEngine on
       SSLCertificateFile [...]/[domain].crt
       SSLCertificateKeyFile [...]/[certificate].key
       SSLCertificateChainFile [...]/[theotherone].crt
         <Directory "[docRoot]">
        AllowOverride All
        </Directory>
        DocumentRoot [docRoot]
        ServerName [serverName]
</VirtualHost>