githubEdit

SEO URL

Configuring SEO-friendly URLs and URL aliases in OpenCart 4

Video Tutorial

Video: Managing SEO URLs in OpenCart 4

Introduction

SEO URLs in OpenCart 4 allow you to create clean, readable URLs that improve search engine rankings and user experience. Instead of complex URLs with multiple parameters, you can use keyword-based URLs that are easier for both customers and search engines to understand.

SEO URL List

SEO URL List

The SEO URL list displays all the URL aliases currently configured in your store. From here, you can:

  • Add New: Create a new SEO URL mapping

  • Edit: Modify existing mappings

  • Delete: Remove SEO URL mappings

  • Filter: Search for specific mappings by keyword, route, or language

circle-info

Pro Tip: Use the filter feature to quickly find specific URL mappings when managing a large number of aliases across different stores and languages.

Enabling SEO URLs

Before custom SEO URLs will work on your storefront, you must enable the feature in your system settings.

1

Access Store Settings

  1. Log in to your OpenCart admin panel.

  2. Navigate to System → Settings.

  3. Click the Edit button next to your store.

2

Enable SEO URLs

  1. Go to the Server tab.

  2. Find the Use SEO URL option.

  3. Set it to Yes.

  4. Click Save.

3

Configure Server Rewriting

Depending on your server, you may need to:

  • Apache: Rename htaccess.txt to .htaccess in your root directory and ensure mod_rewrite is enabled.

  • Nginx: Add specific rewrite rules to your server configuration block.

  • IIS: Install the URL Rewrite module and configure web.config.

circle-exclamation

Creating/Editing SEO URLs

When you create or edit an SEO URL mapping, you will fill out a form with the following fields:

SEO URL Form

Mapping Configuration

  • Store: Select which store this mapping applies to (for multi-store setups).

  • Language: Select which language this keyword is for (for multi-language setups).

  • Key: The URL query parameter key (e.g., route, product_id, category_id).

  • Value: The value for the key (e.g., product/product, 42, 20).

  • Keyword: The friendly URL alias you want to use (e.g., iphone-15).

  • Sort Order: Controls priority if multiple keywords match the same route.

circle-info

Key & Value Pairs: For a typical product page, you would have two entries:

  1. Key: route, Value: product/product

  2. Key: product_id, Value: 42

circle-check

Best Practices

chevron-rightURL Structure & Strategyhashtag

SEO URL Guidelines

Structure Guidelines:

  • Keep it Simple: Short, descriptive URLs perform better.

  • Use Keywords: Include relevant keywords naturally in the URL.

  • Hyphens over Underscores: Search engines prefer hyphens as word separators.

  • Consistency: Use lowercase consistently to avoid case-sensitivity issues on some servers.

Optimization:

  • Avoid Parameters: Keep URLs clean without unnecessary query parameters.

  • Hierarchy: Use forward slashes to indicate category depth (e.g., /clothing/men/shirts).

  • Breadcrumb Alignment: Try to make URLs reflect the site's logical structure.

circle-check
chevron-rightMulti-Store & Multi-Languagehashtag

Internationalization Best Practices

Localization:

  • Localized Keywords: Create keywords in the local language for each active language (e.g., /about-us vs /sobre-nosotros).

  • Store Specificity: If you have different branding for different stores, use store-specific keywords.

  • Consistency: Maintain a similar URL structure across languages where possible.

circle-info

Hreflang Support: OpenCart automatically handles the technical SEO aspects of multi-language URLs, but you must provide the localized keywords.

Common Tasks

1

Creating a Custom Alias for a Page

  1. Navigate to Design → SEO URL.

  2. Click Add New.

  3. Select the Store and Language.

  4. Enter route for the Key and the page route (e.g., information/contact) for the Value.

  5. Enter your desired Keyword (e.g., contact-us).

  6. Click Save.

2

Fixing a 404 Error on SEO URLs

  1. Verify "Use SEO URL" is set to "Yes" in System Settings.

  2. Check that .htaccess exists and has the correct rewrite rules.

  3. Ensure the keyword is unique and doesn't conflict with other mappings.

  4. Clear the system cache.

Warnings and Limitations

triangle-exclamation

Troubleshooting

chevron-rightSEO URLs Not Working (404 Error)hashtag

Problem: Friendly URLs return a 404 page

Diagnostic Steps:

  1. Setting Check: Go to System > Settings > Server and confirm "Use SEO URL" is Enabled.

  2. Server Configuration: Check if .htaccess (Apache) or server config (Nginx) is present.

  3. Keyword Check: Verify the keyword actually exists in Design > SEO URL.

Quick Solutions:

  • Rename htaccess.txt to .htaccess.

  • Ask your host if mod_rewrite is enabled.

  • Re-save the SEO URL mapping.

chevron-rightDuplicate Keywordshashtag

Problem: Error when saving a keyword

Diagnostic Steps:

  1. Search: Use the filter on the SEO URL list to find if the keyword is already in use.

  2. Conflict Resolution: Check if the keyword is used by another category, product, or information page.

Quick Solutions:

  • Use a different, more specific keyword.

  • Delete the old mapping if it's no longer needed.

"Clean and descriptive URLs are the maps of your store's digital landscape. Mastering SEO URLs ensures both search engines and customers can find their way easily."

Last updated