SEO: Canonicalization

User avatar
alledia
Joomla! Ace
Joomla! Ace
Posts: 1067
Joined: Tue Jul 18, 2006 3:55 pm
Contact:

SEO: Canonicalization

Post by alledia » Tue Mar 25, 2008 4:58 pm

1. INTRODUCTION

Making sure that Google doesn't treat http://www.mydomain.com or mydomain.com as different domains

2. SCOPE

Canonicalization is big word I can rarely spell but the idea is pretty simple. If the site is based on http://www.mydomain.com or mydomain.com, all the pages will show the same way. Currently we need to add extra lines of code in .htaccess to do this. Wordpress does it automatically.
Joomla extensions and templates: http://Joomlashack.com

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEO: Canonicalization

Post by AmyStephen » Tue Mar 25, 2008 8:50 pm

No. I do not agree that we would automatically decide people can't have www in their domain name.

Obviously, I think it's a good idea, which is why I added it as a GHOP task and worked with the student to provide documentation on how to do so.

But, not everyone wants this - further, it must be defined in Google Webmaster services, anyway, so it couldn't be taken care of in core.

Wonder about the Wordpress claim. Must be an add-on. Certainly, core WordPress doesn't do this.

Amy :)

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: SEO: Canonicalization

Post by newart » Tue Mar 25, 2008 8:53 pm

AmyStephen wrote: But, not everyone wants this - further, it must be defined in Google Webmaster services, anyway, so it couldn't be taken care of in core.
exactly my idea, sorry I agree with Amy. I don't see a very need for that!
former Q&T WorkGroup Joomla member - Italian Translation Team Member

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEO: Canonicalization

Post by AmyStephen » Tue Mar 25, 2008 8:55 pm

Who in the world would be sorry that they agree with Amy? :D

User avatar
alledia
Joomla! Ace
Joomla! Ace
Posts: 1067
Joined: Tue Jul 18, 2006 3:55 pm
Contact:

Re: SEO: Canonicalization

Post by alledia » Tue Mar 25, 2008 9:00 pm

Misunderstanding here ... Wordpress helps you if you want www OR non-www

They simply help you maintain your choice across the whole site.
Joomla extensions and templates: http://Joomlashack.com

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEO: Canonicalization

Post by AmyStephen » Wed Mar 26, 2008 3:09 pm

If it could be handled in the router and there was a new Global configuration option that could be activated only if you used an .htaccess file, then I agree, this would be a nice feature to have. It can make a significant difference on your Google Page Rank. (I wonder, though, if Google will ever fix this.)

Thanks for helping me understand this better.

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Fri Apr 11, 2008 3:59 am

Can you give a more formal example of how things should be changed, for example, with http://www.joomla.org with examples of what is happening now and what should happen.
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

User avatar
alledia
Joomla! Ace
Joomla! Ace
Posts: 1067
Joined: Tue Jul 18, 2006 3:55 pm
Contact:

Re: SEO: Canonicalization

Post by alledia » Fri Apr 11, 2008 12:14 pm

From Matt Cutts at Google:
http://www.mattcutts.com/blog/canonicalization-update/
Some people ask “Why don’t you just assume http://www.example.com and example.com are the same?” The answer is that they don’t have to be, and for some websites they are different. For example, http://phpicalendar.net/ is a different page than http://www.phpicalendar.net/. This happens more often than you might think; FindWhat has different www vs. non-www pages, for example.
So http://www.joomla.org and joomla.org can be indexed and ranked as if they were separate sites. Not definitely going to happen, but its possible. Currently I see the same content if I visit http://www.joomla.org and http://joomla.org.

In 1.0 $mosConfig_live_site would be the logical choice to set the choice of www or non-www. In Joomla 1.5 I'm not so sure.

Wordpress info:
http://wordpress.org/support/topic/156533
http://perishablepress.com/press/2008/0 ... wordpress/
Joomla extensions and templates: http://Joomlashack.com

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Fri Apr 11, 2008 2:13 pm

1.5.1 has a live_site variable in it if you need to use it, though upgrade to 1.5.2 if possible.

I will check out what Wordpress has got going soon to see how they handle things.
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Fri Apr 25, 2008 12:00 pm

Still haven't gotten around to checking out wordpress, but give what I've attached a go. Basically you install it, feed it the correct hostname and when the hostname doesn't match (as per $_SERVER['HTTP_HOST']) then it resets the location, sends a 301 (Moved Permanently) and kills the app. Let me know if this is similar to what you're chasing and resolves the issue for you.

edit: updated XML installer and swapped a variable
edit 2: updated to fix SSL detection code
You do not have the required permissions to view the files attached to this post.
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

User avatar
alledia
Joomla! Ace
Joomla! Ace
Posts: 1067
Joined: Tue Jul 18, 2006 3:55 pm
Contact:

Re: SEO: Canonicalization

Post by alledia » Fri Apr 25, 2008 3:17 pm

Thanks Sam

Tested this on 1.5.3 but couldn't get any traction.

Could you post some quick instructions for setup?
Joomla extensions and templates: http://Joomlashack.com

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Sat Apr 26, 2008 1:36 am

All you need to do is feed the correct value of HTTP_HOST into the plugin's params and it'll update any URL with a 301 to point to the correct HTTP_HOST. And publish it as well. To test just go to your site at one of its alternate addresses, so in my case I used sammoffatt.com.au and hit it on http://www.sammoffatt.com.au instead.
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Sat Apr 26, 2008 3:01 pm

I've updated the original to fix an issue with SSL detection now that I've tested some stuff on an SSL enabled server. I've replaced the original attachment with the new one (only a slight change).
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

Hokuszpok
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Apr 25, 2008 1:25 pm

Re: SEO: Canonicalization

Post by Hokuszpok » Sun Jul 06, 2008 6:09 am

In my case the plugin didnt work well, it went into an endless redirecting loop.

My site is on a free host, the free name for the site is http://XXX.extra.hu. Now I got a real domain name for the site, which is http://XXX.hu, plus I got the www version with it too, which is http://www.XXX.hu.

I wanted to use the http://www.XXX.hu name variant everywhere. The problem with your plugin is that the HTTP_HOST in my case points to either XXX.extra.hu or XXX.hu depending on the call, but never contains the http://www.XXX.hu - which I wanted to use! So if I set the preferred hostname to http://www.XXX.hu in admin with your plugin, I got into an endless loop, because the plugin will NEVER see the www variant, so always tries to redirect :(

Your code in my setup successfully hides the original free name XXX.extra.hu, but can't tell http://www.XXX.hu and XXX.hu apart.

I replaced HTTP_HOST with SERVER_NAME which returns not the hostname, but the virtual host name. It seems to work in my (somewhat weird) setup!

Thanks for your plugin, I was looking for this one for some time!
(btw XXX = 'enekelazorszag', its a long hungarian name of a project)

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Sun Jul 06, 2008 6:44 am

That is rather strange, I just looked on my local machine and SERVER_NAME returns 127.0.0.1 whilst HTTP_HOST returns 'localhost'. My VHOST server returns the correct name (sammoffatt.com.au), that said, so does HTTP_HOST. I'll look into putting an option in to change it.
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

Hokuszpok
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Apr 25, 2008 1:25 pm

Re: SEO: Canonicalization

Post by Hokuszpok » Sun Jul 06, 2008 7:00 am

My host is free one with some weird setup. They disable .htaccess, and lot of php functions - even realpath in php (I had to modify some Joomla files because of that one). So my case may be rather unique.

Anyway the plugin works nicely after I replaced HTTP_HOST with SERVER_NAME.

User avatar
alledia
Joomla! Ace
Joomla! Ace
Posts: 1067
Joined: Tue Jul 18, 2006 3:55 pm
Contact:

Re: SEO: Canonicalization

Post by alledia » Sun Jul 06, 2008 1:41 pm

Thanks Sam for the plugin.

I wonder if there's a way to include it as a core function.

After all, researching, downloading, installing and configuring is a longer process than the original solution ... just adding two lines to the .htaccess file.
Joomla extensions and templates: http://Joomlashack.com

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Mon Jul 07, 2008 5:53 am

I've updated the extension to handle both SERVER_NAME as well so if either it or HTTP_HOST matches it will not redirect. I've also added an option to disable it in the backend (enabled by default) and a simple check function with an iframe to validate settings. If you end up with a browser error then something isn't right otherwise it should come up with success.

re: including it into 1.6 (1.5 is out of the question), I'll have a chat with the powers that be about including it and see what they think. It needs a bit of a clean up before it gets into core but I don't see too many issues. If it does get included chances are it'll be almost identical code so if you can test this now and see how it works then that'd be a good start. Finally whilst it may be harder, on platforms that don't have .htaccess files this solution still works as well which is good.

Download here:
http://joomlacode.org/gf/project/pasami ... ge_id=3609
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

tim1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Fri Apr 20, 2007 1:35 pm
Location: Melbourne
Contact:

Re: SEO: Canonicalization

Post by tim1980 » Mon Jul 07, 2008 1:41 pm

thanks so much for creating this plugin
im using it on www.PanicIndustry.com

I also have .net .org .tv and it works to redirect them all to .com excellent
http://www.OSGUI.com
Open Source, Operating Systems, & Graphical User Interfaces. We try to promote Ubuntu Linux and much more.

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Tue May 12, 2009 12:31 pm

Hi Tim,

Great to hear that it works for you, would you also be interested in posting a review or ranking on the JED?

http://extensions.joomla.org/extensions ... 55/details

Cheers,

Sam
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

kolkataseo
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jun 02, 2009 12:42 pm
Location: kolkata
Contact:

Re: SEO: Canonicalization

Post by kolkataseo » Tue Jun 02, 2009 5:32 pm

this is one simple yet power tweak for SEO which alot of people miss out

User avatar
Vespre
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Jun 28, 2009 8:29 pm
Contact:

Re: SEO: Canonicalization

Post by Vespre » Sun Jun 28, 2009 9:03 pm

The canonical tag will (is claimed to, at least) solve this issue now. A 301 redirect from either www to without or the other way around is a safer bet though.
Only literal URLs allowed. See forum rules for details.

User avatar
VitalBodies
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Fri Feb 13, 2009 6:34 am

Re: SEO: Canonicalization

Post by VitalBodies » Mon Jun 29, 2009 10:15 pm

Awesome, helpful, supportive. This plug-in helps!
-
http://www.VitalBodies.net
Home, Art, Lifestyle, Shop, Tech & News...

RickGlaser
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Apr 20, 2009 2:38 am
Contact:

Re: SEO: Canonicalization

Post by RickGlaser » Wed Jul 22, 2009 10:44 pm

Alledia, thanks for pointing this out. Many people overlook this important factor, and actually can get punished for duplicate content. The pronunciation well that would be pronounced KAH-nahn-nihk-uhl-ih-ZAY-shun for anyone wondering.

:)
http://www.highrankingseo.net Florida Internet Marketing
http://twitter.com/RikGlaser
Follow Me!

tim1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Fri Apr 20, 2007 1:35 pm
Location: Melbourne
Contact:

Re: SEO: Canonicalization

Post by tim1980 » Mon Oct 19, 2009 5:04 am

Thanks again for this, years later I had to find this plugin again

im still confused abou tit though, what is a .htaccess way of doing this?
http://www.OSGUI.com
Open Source, Operating Systems, & Graphical User Interfaces. We try to promote Ubuntu Linux and much more.

tim1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Fri Apr 20, 2007 1:35 pm
Location: Melbourne
Contact:

Re: SEO: Canonicalization

Post by tim1980 » Mon Oct 19, 2009 5:09 am

oh no it does not work anymore with 1.5.14

The page isn't redirecting properly




Firefox has detected that the server is redirecting the request for this address in a way that will never complete.








* This problem can sometimes be caused by disabling or refusing to accept
cookies.
http://www.OSGUI.com
Open Source, Operating Systems, & Graphical User Interfaces. We try to promote Ubuntu Linux and much more.

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Mon Oct 19, 2009 5:32 am

It works perfectly fine on my 1.5.14 site, I'd look to something else to work out what is going on. Redirect loops occur when you redirect to one place and then back to where you redirected from and around and around until the browser gets dizzy and sits down. There is potentially a configuration alteration somewhere on your side that could have caused it but my 1.5.14 sites are working perfectly fine.
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

User avatar
dubjohnston
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Fri Aug 21, 2009 2:49 pm
Location: Melbourne, Australia
Contact:

Re: SEO: Canonicalization

Post by dubjohnston » Wed Nov 25, 2009 6:31 pm

Hi Sam,

Thanks for the work you put in.. I used to use a different Canonicalization plugin but thought id give yours a go as the old one i still had to touch the htaccess file.. I downloaded your plugin and when i type in the address i want it pointed to 'www.majorchord.net' it tells me that 'Failure! Domains dont match'.

I clicked rewrite (brand new site so didn't matter if i stuffed up) but it couldn't find a connection.

I am using 1.5.15 and haven't renamed htaccess.txt to .htaccess yet.. do i need to?


Search Engine Friendly URLs: Yes
Use Apache mod_rewrite: No
Add suffix to URLs: No

your help would be much appreciated..

cheers

dub

pasamio
Joomla! Ace
Joomla! Ace
Posts: 1318
Joined: Thu Aug 18, 2005 9:27 am
Location: San Jose, CA, USA
Contact:

Re: SEO: Canonicalization

Post by pasamio » Thu Nov 26, 2009 12:28 am

Going from memory, when you're doing the test, you've hit apply first (without enabling the plugin; think that should work properly)? Will have to have a look over the code which is always time consuming. Lots of time!
Sam Moffatt
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.

User avatar
dubjohnston
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Fri Aug 21, 2009 2:49 pm
Location: Melbourne, Australia
Contact:

Re: SEO: Canonicalization

Post by dubjohnston » Mon Dec 07, 2009 11:08 am

Hi Sam,

Thanks for the fast reply.. I tried what you suggested.. still showing without the www..

since last time I have amended the site settings as below and renamed the htaccess file

Search Engine Friendly URLs: Yes
Use Apache mod_rewrite: Yes
Add suffix to URLs: No

Can i double check i am doing it all right.. i cold be missing something simple.. I want all domains to have www.

Correct Host: www.gengreen.com.au
Backend enabled: yes

when i click on a menu item for example.. still goes to non-www site

thanks again for your help mate..

cheers

dub


Locked

Return to “Under Review - Archived”