SEO: Canonicalization
- alledia
- Joomla! Ace
- Posts: 1070
- Joined: Tue Jul 18, 2006 3:55 pm
- Contact:
SEO: Canonicalization
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.
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
-
- Joomla! Champion
- Posts: 7018
- Joined: Wed Nov 22, 2006 3:35 pm
- Location: Nebraska
- Contact:
Re: SEO: Canonicalization
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
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
- newart
- Joomla! Virtuoso
- Posts: 3177
- Joined: Fri Sep 02, 2005 10:06 am
- Location: Solar system - Earth - European Union
Re: SEO: Canonicalization
exactly my idea, sorry I agree with Amy. I don't see a very need for that!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.
former Q&T WorkGroup Joomla member - Italian Translation Team Member
-
- Joomla! Champion
- Posts: 7018
- Joined: Wed Nov 22, 2006 3:35 pm
- Location: Nebraska
- Contact:
Re: SEO: Canonicalization
Who in the world would be sorry that they agree with Amy?
- alledia
- Joomla! Ace
- Posts: 1070
- Joined: Tue Jul 18, 2006 3:55 pm
- Contact:
Re: SEO: Canonicalization
Misunderstanding here ... Wordpress helps you if you want www OR non-www
They simply help you maintain your choice across the whole site.
They simply help you maintain your choice across the whole site.
Joomla extensions and templates: http://Joomlashack.com
-
- Joomla! Champion
- Posts: 7018
- Joined: Wed Nov 22, 2006 3:35 pm
- Location: Nebraska
- Contact:
Re: SEO: Canonicalization
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.
Thanks for helping me understand this better.
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
- alledia
- Joomla! Ace
- Posts: 1070
- Joined: Tue Jul 18, 2006 3:55 pm
- Contact:
Re: SEO: Canonicalization
From Matt Cutts at Google:
http://www.mattcutts.com/blog/canonicalization-update/
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/
http://www.mattcutts.com/blog/canonicalization-update/
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.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.
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
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
- alledia
- Joomla! Ace
- Posts: 1070
- Joined: Tue Jul 18, 2006 3:55 pm
- Contact:
Re: SEO: Canonicalization
Thanks Sam
Tested this on 1.5.3 but couldn't get any traction.
Could you post some quick instructions for setup?
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
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Fri Apr 25, 2008 1:25 pm
Re: SEO: Canonicalization
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)
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)
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Fri Apr 25, 2008 1:25 pm
Re: SEO: Canonicalization
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.
Anyway the plugin works nicely after I replaced HTTP_HOST with SERVER_NAME.
- alledia
- Joomla! Ace
- Posts: 1070
- Joined: Tue Jul 18, 2006 3:55 pm
- Contact:
Re: SEO: Canonicalization
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.
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
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
-
- Joomla! Apprentice
- Posts: 15
- Joined: Fri Apr 20, 2007 1:35 pm
- Location: Melbourne
- Contact:
Re: SEO: Canonicalization
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
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.
Open Source, Operating Systems, & Graphical User Interfaces. We try to promote Ubuntu Linux and much more.
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Jun 02, 2009 12:42 pm
- Location: kolkata
- Contact:
Re: SEO: Canonicalization
this is one simple yet power tweak for SEO which alot of people miss out
- Vespre
- Joomla! Apprentice
- Posts: 19
- Joined: Sun Jun 28, 2009 8:29 pm
- Contact:
Re: SEO: Canonicalization
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.
- VitalBodies
- Joomla! Apprentice
- Posts: 16
- Joined: Fri Feb 13, 2009 6:34 am
Re: SEO: Canonicalization
Awesome, helpful, supportive. This plug-in helps!
-
- Joomla! Apprentice
- Posts: 29
- Joined: Mon Apr 20, 2009 2:38 am
- Contact:
Re: SEO: Canonicalization
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!
http://twitter.com/RikGlaser Follow Me!
-
- Joomla! Apprentice
- Posts: 15
- Joined: Fri Apr 20, 2007 1:35 pm
- Location: Melbourne
- Contact:
Re: SEO: Canonicalization
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?
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.
Open Source, Operating Systems, & Graphical User Interfaces. We try to promote Ubuntu Linux and much more.
-
- Joomla! Apprentice
- Posts: 15
- Joined: Fri Apr 20, 2007 1:35 pm
- Location: Melbourne
- Contact:
Re: SEO: Canonicalization
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.
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.
Open Source, Operating Systems, & Graphical User Interfaces. We try to promote Ubuntu Linux and much more.
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
- dubjohnston
- Joomla! Apprentice
- Posts: 13
- Joined: Fri Aug 21, 2009 2:49 pm
- Location: Melbourne, Australia
- Contact:
Re: SEO: Canonicalization
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
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
my websites: http://www.reflexmedia.com.au and http://www.quotemywheels.com.au
-
- Joomla! Ace
- Posts: 1318
- Joined: Thu Aug 18, 2005 9:27 am
- Location: San Jose, CA, USA
- Contact:
Re: SEO: Canonicalization
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.
Updater, Installer and Authentication Systems
JoomlaCode Backend Systems
Pie.
- dubjohnston
- Joomla! Apprentice
- Posts: 13
- Joined: Fri Aug 21, 2009 2:49 pm
- Location: Melbourne, Australia
- Contact:
Re: SEO: Canonicalization
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
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
my websites: http://www.reflexmedia.com.au and http://www.quotemywheels.com.au