SEO www redirects in htaccess (code included)
How about this to help improve SEO.
Will require hand editting to enable correct rule and domain name.
I have this running my my site without problem.
Needs to be the first rewrite rule in the list.
:)
Needs to be the first rewrite rule in the list.
# redirect all to http://www.example.com/...
#
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# redirect http://www.example.com/... to http://example.com/...
#
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
:)