WordPress Permalink 404 with HTTPS
The time had come to switch this blog to HTTPS given the ease and cost ($0) of deploying certificates from LetsEncrypt. So that was easily done under Apache – create a new conf file for the SSL site in /etc/apache2/sites-available, and then update the old conf for the non-SSL site to redirect before requesting a new cert using certbot-auto -d mike.mcmurray.co.nz –apache. WP handled that just fine but only the admin pages and the main home page displayed as expected, other pages were just a 404.
So I made the .htaccess file writable by WP and updated the permalink rules from the WP admin console to have the file updated. Nope, still the same.
The rewrite rules are the issue, it’s just that they’re not being allowed to work. The new conf file for the SSL config needs to allow the web server to override the more secure defaults. So this needs to be in the SSL configuration file – note this is a sub-section, not the whole thing.
<VirtualHost _default_:443> ServerAdmin admin@yoursite.com ServerName blog.yoursite.com ServerAlias blog.yoursite.com DocumentRoot /var/www/html/blog ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html/blog/> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on ... </VirtualHost>
3 Replies to “WordPress Permalink 404 with HTTPS”
Great article, that fixed my problem! Thanks!