To minimize load times (save a DNS lookup) do this
Redirecting www to non www or vice versa.
Redirect from non-www to www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Redirect from www to non-www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Or the HTTPS version:
Redirect from www to non-www
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
Redirect from non-www to www
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Use the first if you decided your domain is http://www.yourdomain.com and the second if you decided your domain is http://yourdomain.com
And in WordPress settings set the url according to your decision.
It doesnt matter which yoy choose, but it maters that you make a choice!
Redirecting www to non www or vice versa.
Redirect from non-www to www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Redirect from www to non-www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Or the HTTPS version:
Redirect from www to non-www
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
Redirect from non-www to www
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Use the first if you decided your domain is http://www.yourdomain.com and the second if you decided your domain is http://yourdomain.com
And in WordPress settings set the url according to your decision.
It doesnt matter which yoy choose, but it maters that you make a choice!

TWO offers

