Common causes and solutions for WordPress 404 errors with HTTPS

Solution:

In Apache, the block is required in your SSL VirtualHost configuration (port 443), just like for HTTP (port 80), to allow .htaccess override rules for WordPress.

Example configuration:


<VirtualHost *:443>
    ...
    ...
    ...

    <Directory /var/www/html/domain.com/>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

This ensures that WordPress’s rewrite rules and other .htaccess directives work correctly over HTTPS.