Thread: 301 redirection
View Single Post
Old 02-12-2012, 01:11 PM  
brentbacardi
Confirmed User
 
brentbacardi's Avatar
 
Industry Role:
Join Date: Nov 2009
Posts: 1,425
Look in your .htaccess file

Redirect www to non-www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

Redirect non-www to www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

You should ALWAYS use one of these redirects everytime! This way search engines know which one you want to use and there is no danger in getting duplicate listings/penalties/etc for two different sites with the exact same content.
__________________
Go Fuck Yourself!

Last edited by brentbacardi; 02-12-2012 at 01:13 PM..
brentbacardi is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook