I want to combine my www and non www and keep the link jucie from both - seo

My website shows up for some keywords in the www and some in the non www. Seaquake shows more links to the non www version. It is a PR2 either way. I would like to combine the link juice of the two versions into the non www version. Does anyone know the best way to combine the two and keep the link juice of both. It is as simple as a 301 redirect and if so does the 301 need to be handled in any specific way.

Yep, you choose the one you want (without www.) and you
301 redirect the other to the one you choose. (Using an htaccess directive to always remove the www. part for instance).

The best way to do this is to use the rel canonical tag in your website. Check out this from the google webmaster tools:
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

The preferred domain is the one that you would liked used to index your site's pages. Links may point to your site using both the www and non-www versions of the URL.
For Instance:
http://www.example.com and http://example.com
The preferred domain is the version that you want used for your site in the search results.
Visit Google Web Master Tools for information on Canonical domain and what to prefer.

Related

Remove all http://www.example.com but keep http://example.com without www

I changed my URL from http://www.example.com to http://example.com expecting some time where Google would update. Also I made redirects in .htaccess from www traffic to non-www traffic.
However I still see est. 2500 links in Google using the www after almost two month and most of them are now outdated links so this means that the user is ending up on the frontpage.
I am considering to request Google to remove all the http://www. links to solve the 404 problem.
But is this recommended and how do I do it?
Have you tried setting your preferred domain in your google webmaster tools account?
No it is not recommended. But you can accelerate the process by submitting a sitemap with the http links to your pages and a recent lastmod date. It will force Google to recrawl these pages and notice the 301 redirects.

guidelines for htaccess code to transition users to new website

Suppose I have an old website with 10 webpages, and I want to deprecate it and move visitors to a new website with 100 webpages.
Two of the webpages of the old website map directly to two corresponding webpages on the new website. All other pages on the old website should go to the new website's home page. How to set that up?
I know I can use .htaccess in the public_html folder of the old website to create some permanent redirect rules for individual pages. So for the two pages that need to map one-to-one, I can do:
Redirect 301 /oldfile1.htm http://www.example.net/newfile1.htm
Redirect 301 /def/oldfile2.htm http://www.example.net/123/456/newfile2.htm
But what about all the other webpages on the old website? This is where my knowledge of .htaccess lacks. Does the .htaccess stop executing when it reaches one of the redirects above? If so, then perhaps I simply place the following AFTER the above code to catch the remaining pages?
Redirect 301 / http://www.example.net/
Or, something else? Also, will the redirect directly above map all webpages it sees to the home page of the new website (I assume so), or a matching directory/webpage page on the new website? -- That is, I don't want the situation where http://www.olddomain.com/abc/Oldfile1234.html takes users to http://www.example.net/abc/Oldfile1234.html on the new website (rather, it should take users to http://www.example.net) since most webpages do not map one-to-one.
Lastly, in the .htaccess file on the old website public_html directory, how to account for users coming from https versus http, and www versus non-www URLs?
I'm hoping there's common strategy people use for this sort of thing, since it should be fairly common, so I don't have to re-invent one.
You should be using RedirectMatch for precise matching using regular expressions. You can place these rules in root .htaccess:
RedirectMatch 301 ^/oldfile1\.htm$ http://www.example.net/newfile1.htm
RedirectMatch 301 ^/def/oldfile2\.htm$ http://www.example.net/123/456/newfile2.htm
RedirectMatch 301 ^ http://www.example.net/

Using .htaccess to remove www canonical: should I still verify www and non-www in webmaster tools?

I have an SEO guy that is confusing me. He mentioned that in Google Webmaster Tools I should verify the www version of a site along with the non www (the non www is already verified). So I informed him there's no need because I use .htaccess to 301 redirect all www urls to the non-www url for canonical reasons (like Matt Cutts recommends). He tells me that I still should verify both versions.
I see verifying as me telling Google I want them to index things on a certain domain/subdomain...and the whole point of the canonical is that I DON'T want them indexing www subdomain urls! Not to mention, if every request to the www subdomain is redirected, is it even possible to verify it?
Should I try to do this or should I not verify the www?
Your SEO guy is not an 'SEO moron". You can verify both www prefix and 'non www' prefix in Google Web master tools no problem and then select which one is the preferred domain, www, or non www. You can not select a preferred domain in GWT without verifying both prefixes
Google explains this here:
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=44231
That "SEO guy" is an "SEO moron". If your site can be pulled up with the www and without it you are technically serving up duplicate content and is exactly what Google doesn't want. You are much smarter then that "SEO guy". You're doing it the right way. Don't change a thing.
You need to verify both to prove you are the owner of both, because technically with and without www are in fact different websites. www is just a sub-domain, and can point to a different site if need be.
So you must prove to Google you manage both. Then because Google knows you manage both, and have the authority to specify what to do with both domains, you then tell Google the site is to use www (or not, whichever you want), and you keep the redirects.
Google will not index a domain that 301 redirects to another domain.
I do agree that its not nice to have both www and non-www listed in webmaster separately though. But you could in theory have loads and loads of different sites as sub-domains, so they must be treated as different sites by Google.

How to prevent a search engine from indexing a directory for a particular domain?

I have a web hosting package with 2 domains pointing to it. I've noticed on Google that it has indexed the directory of one of the domains for the other domain. Is there a way of preventing this from happening.
You could try with the Robots exclusion standard but is no guarantee.
Redirect all pages of one of your domains to the other one. You can do that with .htaccess and modRewrite similar to this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
This would perform a 301 redirect (Permanently moved) from example.com to www.example.com.
For SEO purposes you never want to have duplicate content (identical pages on different URLs), there should always be exactly one URL for your content, all other possible URLs should redirect to that one.
Updating your robots.txt will definitely solve the problem in the future, but I think the question you should be asking is, How did Google know those pages were there?
First, you should ensure that a user can't traverse your site's filesystem (if your server is *nix, .htaccess should have something like Options -Indexes). And if you had a public link anywhere that joined the two sites on a single domain, that could be how Google found it. If you are careful to keep your site clean and never point to the files in the other docroot, there should be no problem hosting one domain off the subdirectory of another domain.
You can clear Google's index of those pages by using their Webmaster Tools. In order to identify yourself as the site's owner, you'll need to install a unique file (they create it for you) in the root directory of your various document roots, then you can manually update the parts of your site that they've indexed. This applies only to Google.
If you've been indexed by other search engines (and you probably have been if Google indexed you), you should try to figure out how they got there, fix the problem, move the second site to another folder (causing the pages to report 404 Page Not Found on your main domain) and then get the the search engines to reindex.
If you are using Linux, then some additions to your .htaccess file would probably work, but the specifics would depend on your site setup.

Is 301 the correct redirect code for "fake" subdomains?

My site assigns each user a fake subdomain along the lines of
http://username.mysite.com/
which redirects to
http://mysite.com/shop/username
The second link is the one used internally, is assigned as link rel="canonical", and what I want to display in the browser as the correct url, the subdomain is basically just a convenience for my users.
The question is whether 301 is appropriate in this scenario? A 301 redirect is used for a link that now points elsewhere permenantly, which implies that the old link is deprecated. My concern is that I will attract bad SEO juju by using a 301 redirect whilst still advocating / promoting the use of the old link.
Yes, 301 is the correct choice here as search engines will index the final URL rather than the subdomain. I've never heard of any penalty for having too many 301 redirects. Other redirect types less accurately described what you're looking for (temporarily moved, etc.).