Bitnami WordPress redirect www to non-www

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

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

restart apache:

sudo /opt/bitnami/ctlscript.sh restart apache

Everything should work.

Watch the video

https://www.youtube.com/watch?v=k0kJcThlkeM
Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a comment