I’m a big fan of Amazon Lightsail, I find it better than others for WordPress sites. Recently I was trying to redirect one of my WordPress websites, www traffic to non-www by updating .htaccess file but nothing was working.

After reading the Bitnami doc I found in Bitnami WordPress it handles differently.

Edit httpd-prefix.conf by vim or nano

BASH
vim /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf
VIM
RewriteCond "%{HTTP_HOST}" ^www.flutterframework.com$
RewriteRule "^/?(.*)" "%{REQUEST_SCHEME}://flutterframework.com/$1" [L,R=302,NE]

restart apache:

BASH
sudo /opt/bitnami/ctlscript.sh restart apache

Everything should work.

Watch the video