How To Enable .htaccess for Apache on AWS Lightsail WordPress

This will be a very quick tutorial in which I will show you how to enable Apache to read the .htaccess file. WordPress websites and plugins rely on the .htaccess file and Bitnami by default disables Apache from parsing the .htaccess file. Instead they provide a different method of adding parameters however may WordPress plugins and themes may not be able to edit it directly. So in this video I’ll show you how to enable it if you need .htaccess capability.

Steps:

  1. Verify if .htaccess is working – upload this script to your root directory: https://raw.githubusercontent.com/bolt/htaccess_tester/master/htaccess_tester.php
  2. Create a sample .htaccess file in your root directory with these contents:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^.*$ htaccess_tester.php
</IfModule>
  1. Test by visiting your website URL, you will see that the rewrite rules are not being included in Apache.
  2. Enable .htaccess in Apache with AllowOveride set
    • vi /opt/bitnami/apps/wordpress/conf/httpd-app.conf
    • Change AllowOverride None to AllowOverride All
  3. Restart Apache:
    • sudo /opt/bitnami/ctlscript.sh restart apache
  4. Verify .htaccess is working