
photo credit: meneame comunicacions, sl
A largely missed concept with webmasters is how to use 301 redirects. They are the only safe SEO redirect.
With regards to SEO and the duplicate content penalty, you should redirect all non www requests on your domain to www unless there is a special case where this is required for site functionality. This means…
http://tdcreative.net is 301′ed to http://www.tdcreative.net
http://tdcreative.net/my-post is 301′ed to http://www.tdcreative.net/my-post
Any person involved with SEO should know this and it can be achieved with a few lines of .htaccess code placed in the public root of your FTP, sometimes public_html or httpdocs. An example….
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^your-domain.com [nc]
rewriterule ^(.*)$ http://www.your-domain.com/$1 [r=301,nc]
Simply add this code to the top of your .htaccess file.
Very simple, very effective.
6 Responses for "301 Redirect non www to www with 301"
I am using this .htaccess code in my web site
Glad it is working Stuart
I think I am missing the point a bit over here.
What is the benefit of having http://tdcreative.net/something to the http://www. version.
Is that so you don’t have duplicate pages or does it have another purpose?
Hi DoubleJ. Yes, sorting out the canonical records, www and non www is a very SEO based procedure and is recommended to stop duplicate content. I suggest you apply it to every site you have.
How do I do the opposite? redirect www to non www?
Thanks in advance for your help
Try this
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^www.your-domain.com [nc]
rewriterule ^(.*)$ http://your-domain.com/1 [r=301,nc]
Leave a reply
You must be logged in to post a comment.