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 / instead of index.php?route=product/. 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/. Then the startup/seo_url controllerCode that receives a request and prepares data. More in the glossary → 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. 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.
- In the site root, rename
.htaccess.txtto.htaccess. If the.htaccessfile already exists there, move theRewriteRulerules block from the distribution file. - If the store is in a subfolder, change
RewriteBase /toRewriteBase /shop/. - Make sure
mod_rewriteis enabled on your hosting and thatAllowOverrideis allowed for your directory. This is almost always the case on shared hosting, but not always on your own VPS. - Go to System → Settings, click "Edit" next to the store, and open the "Server" tab.
- Enable "Use SEO URL" and click "Save".
- Open a category, a product, and an information page in a private window. Check that they open at their new addresses.

The key line in the standard .htaccess looks like this. It is what passes the address into the _route_ parameter:
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:
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. 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, manufacturerA product brand. Manufacturers have their own pages. More in the glossary →, 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.

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, notkrossovki. 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.

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 /. 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.
Why some links still show ?route= or open the wrong page
If the site has addresses like index.php?route=product/, 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.
You can find products without a keyword with an SQL query. Make a backup first, and substitute your table prefixThe beginning of table names, by default oc_. More in the glossary → and language_id.
OpenCart 3.0:
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:
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:
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 / if you navigate from a category. On top of that, there are sorting, limit, and filter parameters. The core sets a canonicalA tag with the "main" address of a page. It protects against duplicates with parameters. More in the glossary → 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.
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. 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.
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.
Summary
- SEO URLs in OpenCart work as a combination: server rules (
.htaccessor nginx) plus the "Use SEO URL" option plus unique keys in theseo_urltable. - 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 redirectA permanent redirect from an old address to a new one. Mandatory when the structure changes. More in the glossary →.
Next, check indexing and duplicates. The general order of work is described in the article SEO for an online store: where to start, and the remaining technical SEO topics are collected in the store SEO section.