# SEO URLs in OpenCart: how to enable them and what to do when they break

> How to enable SEO URLs in OpenCart 3.0 and 4.1, set SEO keywords correctly, and fix common issues: 404 errors, addresses with ?route=, duplicates, and multilanguage.

Джерело: https://opencartcode.com/en/wiki/seo/opencart-seo-urls
OpenCart: 3.0, 4.1
Оновлено: 2026-11-27

SEO URLs in OpenCart are enabled with a single checkbox, "Use SEO URL", in the store settings. However, they only start working under two conditions: the server must pass addresses to `index.php`, and every product, category, and page must have a unique SEO keyword. Below we describe how to set up SEO URLs in OpenCart 3.0 and 4.1, and cover the problems that cause the store to return 404s, show addresses with `?route=`, or create duplicates.

Examples are for OpenCart 4.1; in 4.0.x, model triggers and event handling differ.

## What SEO URLs are and how OpenCart builds them

SEO URLs (human-readable URLs, friendly URLs) are addresses like `/krosivky/nike-air-max` instead of `index.php?route=product/product&product_id=42`. They give search engines an extra signal about the page's content. Shoppers find such addresses easier to trust, and they are more willingly shared in messengers. SEO URLs alone won't raise rankings. But chaos in addresses can easily break them: duplicates, 404s after renaming, and different URLs for the same page.

The mechanism is the same in both versions. The server rewrites a "clean" address into `index.php?_route_=krosivky/nike-air-max`. Then the `startup/seo_url` [controller](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#controller) splits the string by slashes, looks up each part in the `seo_url` table, and converts it back into parameters: `path`, `product_id`, and so on. When rendering a page, it does the reverse: it replaces parameters in links with keywords. How this works in the code is covered in the article about the [seo_url table and the startup/seo_url controller](https://opencartcode.com/en/wiki/dev-mvc/seo-url-opencart). A store owner only needs to know where the keys are stored and how the versions differ.

| Aspect | OpenCart 3.0 | OpenCart 4.1 |
| --- | --- | --- |
| Where keys are stored | `oc_seo_url`: the `query` fields (for example `product_id=42`) and `keyword` | `oc_seo_url`: separate `key`, `value`, `keyword`, and `sort_order` fields |
| Language in the address | None: the language is taken from the session or cookie, and the key is searched only within the store | The language code is part of the address and has its own record in `seo_url` |
| Key requirement | The field can be left empty, in which case the link will use `?route=` | The product and category form won't save without a key |
| Service pages (contact, specials) | The standard core leaves them with `?route=` | Routes can also have keys in `seo_url` |

## How to enable SEO URLs in OpenCart 3.0 and 4.1

The steps are the same for both versions. First prepare the server, and only then enable the option. Otherwise, all pages except the home page will immediately start returning 404.

1. In the site root, rename `.htaccess.txt` to `.htaccess`. If the `.htaccess` file already exists there, move the `RewriteRule` rules block from the distribution file.
2. If the store is in a subfolder, change `RewriteBase /` to `RewriteBase /shop/`.
3. Make sure `mod_rewrite` is enabled on your hosting and that `AllowOverride` is allowed for your directory. This is almost always the case on shared hosting, but not always on your own VPS.
4. Go to System → Settings, click "Edit" next to the store, and open the "Server" tab.
5. Enable "Use SEO URL" and click "Save".
6. Open a category, a product, and an information page in a private window. Check that they open at their new addresses.

Server tab: the "Use SEO URL" toggle · OpenCart 4.1.0.4

The key line in the standard `.htaccess` looks like this. It is what passes the address into the `_route_` parameter:

```bash
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|webp|js|css|svg)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
```

On nginx, the `.htaccess` file doesn't work at all. This is the most common reason why "SEO URLs won't turn on" on a VPS. The equivalent for the server configuration:

```bash
location / {
    try_files $uri $uri/ @opencart;
}
location @opencart {
    rewrite ^/(.+)$ /index.php?_route_=$1 last;
}
```

If the store is just launching, do this together with the other steps from [setting up OpenCart after installation](https://opencartcode.com/en/wiki/basics/opencart-settings). That way, addresses with `?route=` won't get into the index and later need redirecting.

## How to set SEO keywords for products and categories correctly

The keyword (keyword) is set on the "SEO" tab in the form for a product, category, [manufacturer](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#manufacturer), or information page. There is a separate field for each store and each language. The full list of all keywords is in Design → SEO URL. It's convenient there for finding conflicts and adding keys for service routes.

SEO tab in the product form: keyword field for each language · OpenCart 4.1.0.4

These rules will save you from most breakdowns:

- **Only lowercase Latin letters, digits, and hyphens.** Cyrillic keywords are technically possible, but in links they get converted into `%D0%BA%D1%80...`. Some modules, feeds, and messengers handle them poorly.
- **Transliteration by the official Ukrainian table.** "Krosivky cholovichi" becomes `krosivky-cholovichi`, not `krossovki`. The main thing is one style across the entire catalog.
- **No spaces, underscores, dots, or slashes in product keywords.** In 3.0, a slash is treated as a separator of address parts.
- **Short and without "fluff".** Name, model, or SKU. A 120-character keyword stuffed with product details gains nothing.
- **Uniqueness.** Two records with the same keyword in one store are a guaranteed conflict. The admin checks this on save, but imports and direct SQL inserts bypass that check.

**OpenCart 3.0:** the product address consists only of its keyword. Categories appear in the address only if the product link was generated from a category page (then it contains the `path` parameter). The category keyword is set separately for each level.

**OpenCart 4.1:** the product and category keywords are required, so there won't be empty addresses for new products. However, old products loaded through imports can easily be left without a record in `seo_url`.

Design → SEO URL: list of keywords with filters by keyword and store · OpenCart 3.0.5.1

## Why pages return 404 after enabling SEO URLs

The symptom is simple: the home page works, but any category or product shows "Page not found" or a 404 from the server itself. Determine who is responding, as that determines the diagnosis.

### 404 from the web server (blank Apache or nginx page, without the store design)

The request never reached OpenCart. The causes are: `.htaccess` is not renamed or is not in the root, `mod_rewrite` is disabled, `AllowOverride None` is present, or the server runs nginx without the `@opencart` block. A separate case is a store in a subfolder with the standard `RewriteBase /`. The check takes a minute: open `/index.php?_route_=ключ-товару`. If the product opens, the key and OpenCart are fine, and the culprit is the address rewriting.

### 404 within the store design

OpenCart received the address but could not find one of its parts in the table. When some part of `_route_` is not found, the core substitutes `error/not_found`. That's why the page breaks even because of one outdated segment in the category chain. Typical causes:

- the key was changed, but the old address remains in the theme menu, a banner, or an external link;
- the key was set for a different store (`store_id`) in a multistore setup;
- **OpenCart 4.1:** the address has an incorrect language code, or there is no matching record for the language;
- after moving the site to `config.php`, the old domain or path remained. More on this in the guide on [moving OpenCart to another hosting](https://opencartcode.com/en/blog/perenesennia-saitu-opencart-na-insii-xosting-instrukciia).

> Don't "cure" 404s by disabling SEO URLs on a live store. Search engines already know the new addresses, and after disabling, the index will start receiving other URLs for the same pages en masse. Look for the cause on a copy of the site or in the error log.

## Why some links still show ?route= or open the wrong page

If the site has addresses like `index.php?route=product/product&product_id=42`, that product has no keyword for the current language and store. This happens after an import, after copying products, or after adding a new language. Upload scripts often write products to the database but skip `seo_url`. How to build an import that immediately creates addresses without duplicates is described in the article about the [product import script](https://opencartcode.com/en/wiki/dev-api/opencart-product-import-script).

You can find products without a keyword with an SQL query. Make a backup first, and substitute your [table prefix](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#table-prefix) and `language_id`.

**OpenCart 3.0:**

```sql
SELECT p.product_id, pd.name
FROM oc_product p
JOIN oc_product_description pd
  ON pd.product_id = p.product_id AND pd.language_id = 1
LEFT JOIN oc_seo_url su
  ON su.query = CONCAT('product_id=', p.product_id)
 AND su.store_id = 0 AND su.language_id = 1
WHERE su.seo_url_id IS NULL;
```

**OpenCart 4.1:**

```sql
SELECT p.product_id, pd.name
FROM oc_product p
JOIN oc_product_description pd
  ON pd.product_id = p.product_id AND pd.language_id = 1
LEFT JOIN oc_seo_url su
  ON su.`key` = 'product_id' AND su.`value` = CAST(p.product_id AS CHAR)
 AND su.store_id = 0 AND su.language_id = 1
WHERE su.seo_url_id IS NULL;
```

The second breakdown is when an address leads to the wrong page. This is almost always caused by a duplicate key: the table returns the first match, and a different product or category opens. The check is the same for both versions:

```sql
SELECT store_id, keyword, COUNT(*) AS cnt
FROM oc_seo_url
GROUP BY store_id, keyword
HAVING cnt > 1;
```

In 3.0, the key is searched without regard to language. So an identical key for the Ukrainian and English versions of different entities is also a conflict. Fix duplicates in the admin or under Design → SEO URL, not by deleting rows at random.

**OpenCart 3.0:** by default, the home page, contact, specials, and cart stay with `?route=`. The standard link-building method substitutes keywords only for products, categories, manufacturers, and information pages. Other routes require custom development or a module.

## Address duplicates, multilanguage, and changing keys: what to consider

Even correctly configured SEO URLs in standard OpenCart produce several addresses for one page. In 3.0, the same product is available as `/nike-air-max` and as `/krosivky/cholovichi/nike-air-max` if you navigate from a category. On top of that, there are sorting, limit, and filter parameters. The core sets a [canonical](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#canonical) on the short product address, but it's better to remove the cause itself. There are separate articles on duplicates and canonical in this section, and the filter as a source of junk URLs is covered in the overview of the [product filter in OpenCart](https://opencartcode.com/en/wiki/catalog/opencart-filter).

**Multilanguage.** In 3.0, the language is not part of the address: even if you set separate keywords for each language, following an address does not switch the language, because it is taken from the session or cookie. So search engines may not see separate language versions. For language prefixes like `/en/` and proper multilingual support, a module is needed, for example [SEO Multilang PRO](https://opencartcode.com/en/marketplace/product/seo-multilang-pro). In 4.1, the language code is already in the address, so it's enough to fill in keywords for each language.

**Changing a key.** Every rename makes the old address dead. The core does not create a redirect automatically, in either 3.0 or 4.1. If a page is already indexed or other sites link to it, set up a 301 from the old address to the new one. During a mass structure change, such as migrating from another platform, prepare a mapping table in advance following the [migration plan that preserves traffic](https://opencartcode.com/en/wiki/migration/online-store-migration).

Without code, these tasks on 3.0 are handled by our module OCT SEO Pro. It generates SEO URLs for service pages, removes duplicate product addresses, handles redirects when keys change, and builds a sitemap. A detailed review of its settings is available in the [OCT SEO Pro overview](https://opencartcode.com/en/blog/chpu-redyrekty-sitemap-opencart-3-ohliad-oct-seo-pro).

> Before mass-generating keywords by transliterating names, decide whether you need category segments in the addresses. Changing the structure on a live store with thousands of products is far more expensive than choosing it once at the start.

## Summary

- SEO URLs in OpenCart work as a combination: server rules (`.htaccess` or nginx) plus the "Use SEO URL" option plus unique keys in the `seo_url` table.
- A 404 without the store design means a problem with address rewriting. A 404 within the store design means OpenCart did not find the key.
- Addresses with `?route=` point to missing keys. A wrong page points to duplicates. Both cases are found with the SQL queries above.
- In 3.0, the language is not part of the address, service pages stay without SEO URLs, and a product has several URLs. In 4.1, the language is in the address, and the key is required.
- Any key change requires a [301 redirect](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#301-redirect).

Next, check indexing and duplicates. The general order of work is described in the article [SEO for an online store: where to start](https://opencartcode.com/en/wiki/seo/online-store-seo), and the remaining technical SEO topics are collected in the [store SEO section](https://opencartcode.com/en/wiki/seo).

## FAQ

**Can you use Cyrillic in SEO URLs, for example /кросівки?**

Technically OpenCart allows this, but in links such addresses are encoded into long strings with percent signs, and some modules and feeds handle them incorrectly. For a store, it is safer to use Latin transliteration.

**Should you add .html at the end of product URLs?**

No, the suffix does not affect rankings, and standard OpenCart does not add it. If your store is already indexed with .html, do not change the format without need: it is a mass URL change that requires redirects.

**Will a store lose rankings if SEO URLs are enabled on an already indexed site?**

Short-term fluctuations are possible because all addresses change. To minimize them, set up 301 redirects from the old ?route= addresses to the new ones and update your sitemap.

**What to do if SEO URLs disappear from the menu after a theme update?**

Most often the theme outputs links built manually rather than through the core URL generation method. Check the menu template and replace hardcoded addresses with links generated by the controller.

**Do you need to clear the cache after changing SEO keywords?**

If the menu, modules, or theme cache links, an old address may still appear for some time. Refresh the cache in the admin panel and under modifications in 3.0, then check the page in a private browsing window.
