Apache .htaccess Redirect WWW

This content is 6 years old.Just a few quick notes on how to redirect website to force www or to force just the domain name when users visit your site. .htaccess Redirect non-WWW to WWW This will redirect http://my-domain.com/ to http://www.my-domain.com/ RewriteEngine On RewriteCond %{HTTP_HOST} !^www. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] .htaccess Redirect WWW to non-WWW … Read moreApache .htaccess Redirect WWW