No results found

Try a different search query

Popular searches:

Add to Cart

Cart

You have no purchases yet

Browse Marketplace
Solved

SEO URLs and canonical in OpenCart 4

Є проблема з дублями сторінок в індексі Google.

Один і той же товар доступний за різними URL через категорії.

Як правильно налаштувати canonical URL в OpenCart 4?

a
admin4eg
· 400 views · 3 followers · 3 bookmarked
2

1 answer

31 серпня 2025 (16:08)
Accepted 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.

1

Your Answer

Login to answer this question

Login

Report

We use cookies

We use cookies and similar technologies to improve your experience, analyse traffic, and show personalised ads. Read our Cookie Policy for details.