Need a new web host or having a problem with a script? Tips and advice on the best way to design, build and maintain your most valuable asset - your website!

URL Canonicalization Lesson

darkchanter
Posts: 3
Joined: 29 Jun 09
Trust:

URL Canonicalization Lesson

I was reading the lesson on the similar title and I (may) have a way to use both:

You can write some javaScript (or PHP, I suppose) to redirect from the one to the other. Let's say the mydomain.com is your SEO site, put the following javascript in the HTML header (above the robots meta tag):



As the lesson/article points out, many people will not bother to type the www, they'll go straight to "mydomain.com"; however folks like me will type "mydomain" in their browser and press crtl+enter (which fills in the "www." and ".com" for one and then browses to the site).

I haven't tested this. Does anyone know if search engine spiders will see this as bad linking?
  • 0
Last edited by faradina on 14 Jul 09 10:26 am, edited 1 time in total.
Reason: make title relevant to content
 

Regards
Darren
 
faradina
Posts: 1895
Joined: 01 Jun 09
Trust:
The whole point of the URL Canonicalization lesson is about not using both www and non-www web addresses so as not to divide the link juice and affect page rank. It is about getting the most out of your search engine listing and not only about redirecting from the www address to the non-www address or vice-versa. People will still get to your website whether or not they put in the www. Search engines think that the www is different from the non-www address and will only display one version of your site in the search listings.
  • 0
darkchanter
Posts: 3
Joined: 29 Jun 09
Trust:
Hi Faradina,

I'm not sure that I follow you, if "Search engines think that the www is different from the non-www address" then why would they "only display one version of your site in the search listings"?

Let me put a frame around it, so to speak. I agree that one should only market one of the two, let's say "mydomain.com". What my intent is, is that someone may remember the domain name and type in, or link to, "www.mydomain.com"; so if that traffic is "redircted" to mydomain.com, then mydomain.com will (also) get the traffic that arrived at www.mydomain.com.
  • 0
Regards
Darren
 
faradina
Posts: 1895
Joined: 01 Jun 09
Trust:
Those who type http://www.mydomain.com and those who type mydomain.com will both get to your website. But for search engines, http://www.mydomain.com and mydomain.com are not the same. In searches, people (especially those who do not know of your site, in fact, those who already know of your site would most probably not be searching but go to your website directly ) do not necessarily type in http://www.mydomain.com or mydomain.com. They usually type in queries for whatever they are searching for. If your keywords fit their query terms, your listing will appear, but only one (either domain.com or http://www.domain.com) will be listed in the search results. That's how search engines are. Because search engines think that the www and non-www addresses are different from each other, they treat one as having duplicate content and will not display it in the listing.
  • 0
darkchanter
Posts: 3
Joined: 29 Jun 09
Trust:
Ah, I see - it's the duplicate content rule that I wasn't cognisant of!
  • 0
Regards
Darren
 

This topic was started on Jul 10, 2009 and has been closed due to inactivity. If you want to discuss this topic further, please create a new forum topic.