Email - info@zymphonies.com

Redirecting non-www to www with .htaccess

Redirect all non-www requests to your site to the www version, all you need to do is add the following code to your .htaccess file.

Redirecting non-www to www with .htaccess

What is the use to redirect?

  • Avoid duplicate content in Google
  • Avoid the possibility of split page rank and/or split link popularity (inbound links).
  • It's nicer, and more consistent.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]