Forum Moderators: phranque
I have a client that is getting penalized by Google for having duplicate content on singular & plural domain names (both sites have 800+ duplicate pages)
example.com has 175 pages indexed by Google
examples.com has 51 pages indexed by Google
If we're branding the singular domain (example.com), would a general 301-redirect from examples.com to example.com work, or will I need to set up separate redirects in the .htaccess file for the 51 pages for examples.com that are indexed?
Thanks in advance ;-)
Yes, use a general redirect of *all* examples.com URLs to their equivalent on example.com
[added] And also consider the same problem with URLs on both www.example.com and example.com... [/added]
Jim
[edited by: jdMorgan at 4:59 am (utc) on Aug. 1, 2007]
Thanks for the above response. So, ideally, when I set up the 301-redirect on the plural (examples.com) domain, the current pages that are indexed in Google / Yahoo / MSN, etc. will eventually revert to the singular (example.com) domain for those URL's, right? Then, I wouldn't have to set up a 301-redirect for all of the pages on examples.com in the .htaccess file ... just a general one for that domain which will cover all URLs/files on that domain, right?
For domains hosting at GoDaddy, they now have a 301-redirect option. Is this ok to use, or would you advise a domain being hosted and the 301-redirect code applied to the servers .htaccess file?
Thanks again in advance.
examples.com --> example.com
www.examples.com --> example.com
www.example.com --> example.com
This ensures that only example.com can be indexed.
Point all of the domains at the one hosting plan and put all the redirect rules in the single .htaccess file on that server.
The redirect code is just two lines long for each site-wide condition.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Then, on the "examples.com" .htaccessfile, this code would apply:
redirectMatch 301 ^(.*)$ http://www.example.com
redirectMatch permanent ^(.*)$ http://www.example.com
... right?
The reason why I want to make sure I'm on the same page with this is because if there's already 51 pages indexed on the name we need to set the 301-redirect on, if I do the below code on that .htacess file, would that screw up the 51 pages already indexed, or do need to do each page in the .htaccess file for a 301-redirect.
... sorry for the confusion and thanks for your help
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?examples\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Only pages from www.example.com will be indexed. The 51 pages indexed under the "wrong" domain will soon be reindexed under the correct domain.
They will then also pass internal PageRank to the correct pages on the correct domain too.
When you say "point" all domains to the same hosting w/ only 1 .htaccess file, I'm still a little confused.
For example, when I pick up a domain name w/ a PR-4 from SnapNames, I usually set up separate hosting for that domain and put the 2 lines of code in the .htaccess file for the 301-redirect for that domain, to redirect to the "brandable" domain.
If all domains are suppose to be done on 1 .htaccess file on the brandable domain server, how is the pointing done? A general forward and then the .htaccess file recognizes the domain?
You can use the "point all to one" approach if you're on a dedicated or VPS server, but this would generally not be allowed/supported on name-based virtual hosting.
Jim
I have a 20GB whm/cpanel server from RackForce so setting up multiple hosting accounts isn't difficult, just little extra work.
I just can't comprehend (wrap my brain) around the concept on one .htaccess file on the brandable domain server.
For example, let's say I have a domain at 1and1.com ... if I set a basic domain forward to the brandable domain, are you saying I can put the 301-redirect code on that brandable domain's .htaccess file to recognize that incoming domain is a permanent redirect?
Also - GoDaddy has 301-redirect selection in their backoffice ... in you opinion is this ok/safe/legit, or should the domain be configured for the 301-redirect with regular hosting (using the .htacess file).
Thanks.
Clients (e.g. browsers) ask DNS about a domain name found in a requested URL.
DNS returns an IP address for that domain name.
Clients send the request to that IP address. They also send along the hostname in an HTTP header.
The server config (e.g. httpd.conf) points hostname requests to filesystem directories.
Apache gets the "page" from the filesystem and sends it back to the client.
That's the basis of all of this InterWeb stuff.
Note that things probably don't work exactly the way most people think they do. That's because, prior to HTTP/1.1 only one domain could hosted on an IP address. In response to the threat of running out of IP addresses, hostnames were added, and name-based virtual hosting, where multiple sites share an IP address, became possible. As such, hostnames were just sort of 'bolted on' to the HTTP protocol as an afterthought.
So domain names and hostnames are not quite the same thing, but for the purposes of this post, you can call them equivalent.
cPanel makes some very basic things very easy, but it's a canned, inflexible solution. Mostly it just gets in the way, but it can be used to corrupt your configuration if you wish... :)
If the DNS points all of your domains to your server's IP address, and all hostname requests are configured on the server to go to the same file space, then you could use one .htaccess file to do all the redirects.
Given that you have a better hosting plan level than most participants here, I'd say you might as well just add the extra domains into you account as "separate" hosts, and then redirect from there. The only advantage of the .htaccess approach might be centralized management. But if you're not a coder by nature, then the cPanel approach might be easier for you, and it will be faster performance-wise.
Just to de-mystify, cPanel is a program that can put pre-coded routines into the server configurations files, e.g. httpd.conf, conf.d, and .htaccess. It can change a few variables in those pre-coded routines, but is otherwise not very flexible. It also doesn't "write" very efficient code -- To be accurate, it tends to create very inefficient and ugly code, sometimes with notable flaws in it. It is simply an attempt to allow folks with limited server configuration skills to make a few customizations without blowing up the server and taking down their sites and other sites sharing the same server. In that light, it's an OK app.
Jim
That's basically what I do. When I get a good PageRank domain that I can use for a site, I'll set up hosting for that domain, but instead of playing w/ cpanel, I just use a .txt file and create a .htaccess file ... put in the 2 lines of code to 301-redirect this domain to the domain I want it redirected to, and it's all good.
So, then, for the whole point of my initial post, I'll set up separate hosting for examples.com and code this .htaccess file w/ the right 301-redirect code to redirect to example.com
Thanks for everyone's help ... I appreciate it.
redirectMatch 301 ^(.*)$ [domainname.com...]
redirectMatch permanent ^(.*)$ [domainname.com...]
redirectMatch 301 ^(.*)$ [domain.com...]
redirectMatch permanent ^(.*)$ [domain.com...]
RewriteEngine ON
RewriteRule ^(.*)$ [domain.com...] [R=301,L]
This is what you meant, right?
Thanks!
# mod_alias:
Redirect 301 / http://www.example.com/
Redirect Permanent / http://www.example.com/
RedirectPermanent / http://www.example.com/
RedirectMatch 301 (.*) http://www.example.com/$1
#
# mod_rewrite:
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
If the code is going into a single .htaccess file that is common to all domains, then you must use mod_rewrite, and you must test the requested HTTP_HOST so that you do not redirect if the hostname is already the one you prefer. This code will redirect any request for a hostname other than the preferred (canonical) hostname:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1
Jim