Jump to content
Sign in to follow this  

Canonical url error

Recommended Posts

Hi all!

What can be the reason for that the canonical is not converted in the source of the page for META tags?

<link href="http://qrpparts.com/index.php?_a=product&product_id=254" rel="canonical">

The url rewrite works in the menu and on the product pages, but for example, on the line, below the menu it writes like this:



The google says: User-declared canonical N/A

The htaccess rewrite rules are fine.

Can you give me an idea of which file to watch?
Thanks in advance

Share this post

Link to post
Share on other sites

Welcome QParts! Glad to see you made it to the forums.

URLs that stay as _a=whatever&whatever_id=number indicates the SEO functions (aka, friendly URLs as opposed to standard URLs) are not working.

I would say that you may be running CubeCart 5, but then the skin is definitely Foundation. The Foundation skin can certainly be run on CubeCart 5, but I think this is not the case.

Looking at the /diodes.html page, the only thing not working right is the breadcrumbs (and the canonical link). Same with the /diodes/rf-switching.html page. Bad breadcrumbs and canonical.

So, something is commonly affecting both breadcrumbs and the canonical link.

I notice that you have a link to datasheets. Is this a plugin? If so, temporarily disable it. If you needed to make changes to the code, temporarily restore to the original versions of the CubeCart code files (including changes to the skin).

Share this post

Link to post
Share on other sites

The file /classes/seo.class.php, the method SEOable() is given the standard querystring and returns the friendly.html string. But, a test in /includes/functions.inc.php, currentPage(), first makes sure that the SEO class is instantiated.

So, we may want to watch if the SEO class has been destroyed when GUI->display() gets called.

Adding a breadcrumb in GUI->addBreadcrumb() also uses SEO->SEOable().

But then, so does a lot of other code.

Share this post

Link to post
Share on other sites

Dear bsmither,

I use Cubecart V6.
I copied the original theme, but the same error.
"Datasheet" is not a plugin. Just one link.

I find error_log for such lines.

[28-Jun-2019 06:43:56 UTC] PHP Warning:  preg_match() [<a href='http://docs.php.net/manual/en/function.preg-match.php'>function.preg-match.php</a>]: The /e modifier is no longer supported, use preg_replace_callback instead in /home/brbyx3qrsn4j/public_html/classes/seo.class.php on line 637

Can it be related?

Share this post

Link to post
Share on other sites

Problem resolved!


In seo.class.php, line 637:

if (preg_match('#^(.*/)?[\w]+.[a-z]+\?_a\=([\w]+)(?:\&(amp;)?([\w\[\]]+)\=([\w\-\_]+)([^"\']*))$#ieS', $path, $match)) {

Suggest removing the e modifier, to read:

if (preg_match('#^(.*/)?[\w]+.[a-z]+\?_a\=([\w]+)(?:\&(amp;)?([\w\[\]]+)\=([\w\-\_]+)([^"\']*))$#iS', $path, $match)) {


Thanks for the help! The shop is now working perfectly!

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...