SEO URLs and canonical in OpenCart 4
Є проблема з дублями сторінок в індексі Google.
Один і той же товар доступний за різними URL через категорії.
Як правильно налаштувати canonical URL в OpenCart 4?
1 answer
Canonical URLs in OpenCart 4 are configured like this:
1. In header.twig:
{% if canonical %}
<link rel="canonical" href="{{ canonical }}" />
{% endif %}
2. In controller:
$data['canonical'] = $this->url->link(
'product/product',
'product_id=' . $product_id
);
3. Redirects in .htaccess:
RewriteRule ^category-1/(.*)$ /$1 [R=301,L]
Module I recommend: SEO Pro from OCHUB - solves all these problems automatically.
Your Answer
Login to answer this question
Login