Setting Up .htaccess With Let’s Encrypt

After installing WordPress on my Raspberry Pi LAMP stack, I was unable to get permalinks to work. WordPress had appropriate permissions to .htaccess and was able to edit it, and mod_rewrite was installed and enabled in Apache. I checked my AllowOverride settings in 000-default.conf and that was right too, so I was very confused.

It turns out that since I installed Let’s Encrypt to provide TLS encryption on my site, I needed to add the following to my 000-default-le-ssl.conf file (not 000-default.conf):

<Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
</Directory>

The more you know!