Zen Cart Logo
Forums / General Questions / Canonical links and sitemap

Canonical links and sitemap

Views: 1,584

Results 1 to 8 of 8
27 Jan 2016, 2:13 AM
#1
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Canonical links and sitemap

Hi ran an seo tool on the site I'm working on and I got this message:
Canonical domain check failed
"www" and "non-www" versions should resolve to the same URL

I have a base tag in the head section <base href="https://www.example.com.au/" /> (the domain is example.com.au not https://www.example.com.au)
I've turned the ssl on and the website is correctly redirecting to the https://example.com.au

So do I need now need to add <link rel="canonical" href="https://example.com.au/"> to the head section of the index page?

I also have an error saying https://example.com.au/sitemap.xml - Not Found
Would that be because the base tage says https://www.example.com.au ?

27 Jan 2016, 2:41 AM
#2
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Canonical links and sitemap

Annie_zaz:

Hi ran an seo tool on the site I'm working on and I got this message:
Canonical domain check failed
"www" and "non-www" versions should resolve to the same URL

I have a base tag in the head section <base href="https://www.example.com.au/" /> (the domain is example.com.au not https://www.example.com.au)
I've turned the ssl on and the website is correctly redirecting to the https://example.com.au

So do I need now need to add <link rel="canonical" href="https://example.com.au/"> to the head section of the index page?

I also have an error saying https://example.com.au/sitemap.xml - Not Found
Would that be because the base tage says https://www.example.com.au ?

Ok I solved the robots.txt and sitemap error by generating them and uploading them.
I am still getting the Canonical domain check failed
"www" and "non-www" versions should resolve to the same URL

27 Jan 2016, 6:57 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Canonical links and sitemap

Load a page on your site and then view source
Search for

<link rel="canonical" 

Each page should get a unique canonical link

27 Jan 2016, 3:01 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: Canonical links and sitemap

From the following description:

I have a base tag in the head section <base href="https://www.example.com.au/" /> (the domain is example.com.au not www.example.com.au)

it sounds like your /includes/configure.php (and possible your /admin/includes/configure.php) file has specified:

  define('HTTPS_SERVER', 'https://[B]www.[/B]example.com.au');

If that's the case, remove the offending www. and the canonical links will now be correct for your configuration.

28 Jan 2016, 12:04 AM
#5
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Canonical links and sitemap

kobra:

Load a page on your site and then view source
Search for

<link rel="canonical" ``` > Each page should get a unique canonical link

Hi Kobra, I don't have the <link rel="canonical" in my source. Only the base tag.

28 Jan 2016, 12:21 AM
#6
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Canonical links and sitemap

lat9:

From the following description:

I have a base tag in the head section <base href="https://www.example.com.au/" /> (the domain is example.com.au not www.example.com.au)

> it sounds like your /includes/configure.php (and possible your /admin/includes/configure.php) file has specified:
> ```
  define('HTTPS_SERVER', 'https://[B]www.[/B]example.com.au');

If that's the case, remove the offending www. and the canonical links will now be correct for your configuration.

I removed the www from the define('HTTPS_SERVER', 'https:// and I still got the error inthe seo tool.
So then I removed all the www from the configure files (I hope thats ok) and still get it.
So then I added R=301 in the ht acess file and I still get the error message but on the redirect tool it says all ok.
Maybe it's the tool?
Should I add the www's back in to the http:// ?

28 Jan 2016, 5:54 AM
#7
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Canonical links and sitemap

Annie_zaz:

Hi ran an seo tool on the site I'm working on and I got this message:
Canonical domain check failed
"www" and "non-www" versions should resolve to the same URL

Ditch that tool. Although it is common for the www and non www to resolve to the same URL this is not essential, and in many cases NOT what is needed.

The only time they need to resolve to the same URL is if both are serving up the exact same data (in which case Google will penalise both as being duplicated content).

This alone probably wouldn't make me say 'ditch that tool', but this, combined with your other thread (about the H1 tags) where I also suggested the the tool you are using could be providing a bad report really does make me highly suspicious as to whether the tool can be trusted at all.

Keep in mind that the developers of such tools will often have an ulteria motive in that they'll generate reports of 'problems' in the hopes that you'll employ their services to rectify things for you.

Annie_zaz:

the domain is example.com.au not www.example.com.au)

Technical correction:
'example.com.au' is a host called 'example' that resides in the 'com.au' domain.
'www.example.com.au' is a host called 'www' that resides in the example.com.au domain.

A domain can also be its own host, which is what you are describing as 'example.com'. (which technically, is a host called 'example' that resides in the .com domain.

The 'www' is, and always has been entirely optional. This harks back to the early days of the internet where websites were the realm of large businesses and some technology wasn't quite as advanced as it is today, and seeing URL's like
'www.cocacola.com', 'www2.cocacola.com', & 'www3.cocacola.com' were quite common to spread the load because a single webserver @ cocacola.com couldn't handle it all.

Annie_zaz:

So do I need now need to add <link rel="canonical" href="https://example.com.au/"> to the head section of the index page?

As a general rule, you don't need to concern yourself with the zencart canonical links - they are 'inbuilt' and self generating.

Annie_zaz:

I also have an error saying https://example.com.au/sitemap.xml - Not Found
Would that be because the base tage says https://www.example.com.au ?

No. The cause of a 'Not found' message is because (take a guess)... The file can't be found, generally because it simply doesn't exist.

The sitemap.xml file needs to be created/generated by one of the many tools that are available. There is at least one Zencart module that will create (and recreate) this file automatically.

From a later post you asked

Annie_zaz:

So then I removed all the www from the configure files (I hope thats ok) and still get it.

Removing the 'www's are fine - as long as everything else is in order.

Annie_zaz:

So then I added R=301 in the ht acess file and I still get the error message but on the redirect tool it says all ok.
Maybe it's the tool?

Yup, that'd be my guess.

Annie_zaz:

Should I add the www's back in to the http:// ?

As previously stated, the 'www' really is purely optional, but you will need to be sure that if you DO use it that you have a redirect in place for either the URL with the 'www' or the one without the 'www' (unless of course you are serving up a different page for each - which for most people won't be the case).

For a LONG time I wouldn't use the 'www' for any of our sites because well, frankly, it is pointless, but these days a lot of people think that 'www' is essential - and even if you give them a URL without it, the customer will add it anyway (not to mention that a lot of web browsers will automatically add it if the customer doesn't (sigh)
As such, my approach these days is to add the 'www' as a 'cname' in the DNS and then on the server I'll add a redirect from the 'www' to the actual site (without the 'www').

There isn't a 'www' to be found in either of the zencart configure files.

I will add that this is my prefered way of doing things. If you happen to be one of the many people that place some kind of significance on the 'www' then you may prefer the opposite approach, which is to add a redirect for the URL without the 'www' to the URL with. In this situation your zencart config files will need also need the 'www' for the server name.

Bottom line - it is really just a matter of preference as to what you want your customers to see in the URL when browsing your store, and then configuring to suit your preference. If you try to 'configure' without knowing what you actually want it is all to easy to end up with a system that doesn't work the way it should. .htaccess rules can often 'hide' a misconfigured server so even these should be avoided except for the 'essential' one (www to non www, or vice versa), and even this should only really be put in place after everything is working without any redirects whatsoever. Keep it simple!

Sorry about the rant/lecture or whatever you want it call it. It is in my nature ;-)

Cheers
RodG

29 Jan 2016, 9:50 AM
#8
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Canonical links and sitemap

RodG:

Ditch that tool. Although it is common for the www and non www to resolve to the same URL this is not essential, and in many cases NOT what is needed.

The only time they need to resolve to the same URL is if both are serving up the exact same data (in which case Google will penalise both as being duplicated content).

This alone probably wouldn't make me say 'ditch that tool', but this, combined with your other thread (about the H1 tags) where I also suggested the the tool you are using could be providing a bad report really does make me highly suspicious as to whether the tool can be trusted at all.

Keep in mind that the developers of such tools will often have an ulteria motive in that they'll generate reports of 'problems' in the hopes that you'll employ their services to rectify things for you.

Technical correction:
'example.com.au' is a host called 'example' that resides in the 'com.au' domain.
'www.example.com.au' is a host called 'www' that resides in the example.com.au domain.

A domain can also be its own host, which is what you are describing as 'example.com'. (which technically, is a host called 'example' that resides in the .com domain.

The 'www' is, and always has been entirely optional. This harks back to the early days of the internet where websites were the realm of large businesses and some technology wasn't quite as advanced as it is today, and seeing URL's like
'www.cocacola.com', 'www2.cocacola.com', & 'www3.cocacola.com' were quite common to spread the load because a single webserver @ cocacola.com couldn't handle it all.

As a general rule, you don't need to concern yourself with the zencart canonical links - they are 'inbuilt' and self generating.

No. The cause of a 'Not found' message is because (take a guess)... The file can't be found, generally because it simply doesn't exist.

The sitemap.xml file needs to be created/generated by one of the many tools that are available. There is at least one Zencart module that will create (and recreate) this file automatically.

From a later post you asked

Removing the 'www's are fine - as long as everything else is in order.

Yup, that'd be my guess.

As previously stated, the 'www' really is purely optional, but you will need to be sure that if you DO use it that you have a redirect in place for either the URL with the 'www' or the one without the 'www' (unless of course you are serving up a different page for each - which for most people won't be the case).

For a LONG time I wouldn't use the 'www' for any of our sites because well, frankly, it is pointless, but these days a lot of people think that 'www' is essential - and even if you give them a URL without it, the customer will add it anyway (not to mention that a lot of web browsers will automatically add it if the customer doesn't (sigh)
As such, my approach these days is to add the 'www' as a 'cname' in the DNS and then on the server I'll add a redirect from the 'www' to the actual site (without the 'www').

There isn't a 'www' to be found in either of the zencart configure files.

I will add that this is my prefered way of doing things. If you happen to be one of the many people that place some kind of significance on the 'www' then you may prefer the opposite approach, which is to add a redirect for the URL without the 'www' to the URL with. In this situation your zencart config files will need also need the 'www' for the server name.

Bottom line - it is really just a matter of preference as to what you want your customers to see in the URL when browsing your store, and then configuring to suit your preference. If you try to 'configure' without knowing what you actually want it is all to easy to end up with a system that doesn't work the way it should. .htaccess rules can often 'hide' a misconfigured server so even these should be avoided except for the 'essential' one (www to non www, or vice versa), and even this should only really be put in place after everything is working without any redirects whatsoever. Keep it simple!

Sorry about the rant/lecture or whatever you want it call it. It is in my nature ;-)

Cheers
RodG

Hi Rod,

Thank for all the detailed information. I love the educational feedback and how you answer all my questions.
Yeah I'd say that tool is dodgy and yes SEO people have their motives.
Thanks Again :)