This is one majorly useful but simple code I haven't shared yet so decided to post a topic up of it. Just add this to your website and watch as your site now has/doesn't have www. before it's URL! To Add "www.": RewriteEngine On RewriteCond %{HTTP_HOST} ^your-site.com [NC] RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301] To Remove "www.": Code: RewriteEngine On RewriteCond %{HTTP_HOST} !^your-site.com$ [NC] RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]