In order to prevent duplicates in SE's what's better; a mod_rewrite or a 301 redirect if redirecting a subdomain to a domain? Thanks!
A rewrite is transparent to the user - if not done carefully, it will lead to duplicate content as the same page will be accessible from different URLs. A 301 redirect can't create duplicate content since it tells the user that the page has moved and to request it from its new location.
Ok so if I want to both have all links point at my www. domain and tell Google that my subdomain is moved permanently to my www. domain will this be the code for the .htaccess? # mod_rewrite in use Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] redirect 301 / http://www.domain.com/ Code (markup): The "/" of the 301 means I place it in the root folder of my subdomain right? Thanks! P.S. Did I miss any backslashes?
If you're using the R=301 flag for a RewriteRule, it'll be identical to using a Redirect 301 command.