Hello all,
I am in the process of streamlining our website and am concerned about the fact that we are using BOTH www and non-www. I am going to use a 301 redirect, but I am concerned about losing functionality of the site due to numerous plugins etc that are hard coded to use WWW. So, I suppose my question is, if I use this code that I edited from several sources:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www..*
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^([^.]*).(com|com/)
RewriteRule ^.*$ www.%1.%2%{REQUEST_URI} [R=301,L]
Will this solve our duplication issues sitewide? For instance. if someone visited:
http://example.com/dir1/dir2/dir3/product.php
Would they effectively be led to
http://www.example.com/dir1/dir2/dir3/product.php ?
Basically I am wanting to know if this will work for sitewide redirects versus just redirecting the landing page.
Thanks!
Zak