No results found

Try a different search query

Popular searches:

Add to Cart

Cart

You have no purchases yet

Browse Marketplace
Original Subtotal:
Product discounts:
Quantity Discount:
Total:
View Cart
Solved

SEO URLs and canonical in OpenCart 4

A
admin4eg Member Topic author
#1

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

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

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

Solution by Maria Designer Jump to solution ↓ 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/p...

1 post

M
Maria Designer Module author
· edited Solution #2

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.

Reply to this topic

Log in to reply

Log in

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.