Redirect non-www to www when using Bitnami wordpress on AWS EC2
Solutions
vim /opt/bitnami/apps/wordpress/conf/htaccess.conf
Add these lines
#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.hirepub\.com [NC]
RewriteRule ^(.*)$ http://hirepub.com/$1 [L,R=301]
Check Apache status: sudo /opt/bitnami/ctlscript.sh status apache
Restart Apache: sudo /opt/bitnami/ctlscript.sh restart apache
网友评论