Magento URL Structure Best Practices for Clean Catalog URLs

Magento URL Structure Best Practices for Clean Catalog URLs

Published on July 28, 2026

By Daniel Manco

Key Takeaways

  • Magento URL structure best practices are to use short lowercase paths, omit category paths from product URLs, enable web server rewrites, and apply 301 redirects to every permanent URL change.
  • Removing .html suffixes is straightforward on a new store but requires a complete redirect map on an established store.
  • Keep automatic permanent redirects enabled when URL keys change, but monitor the resulting rewrite table for conflicts and redirect chains.
  • For catalog migrations, map old URLs to their closest relevant destinations before launch and validate the redirects with a full crawl.

Why Magento URL structure matters

A Magento URL tells search engines where a page sits and whether it represents a stable catalog destination. Short, descriptive URLs are easier to crawl, interpret, share, and maintain than paths containing store codes, parameters, or unnecessary category levels.

URL consistency matters just as much as readability. If a product is accessible through several category paths, search engines may spend time crawling duplicate routes. Links may also point to different versions of the same product page, dividing authority across several URLs.

A sound Magento redirect strategy prevents those issues from spreading when teams rename products, reorganize categories, remove suffixes, or migrate a catalog. These principles form one part of a broader Magento SEO strategy. The objective is not to produce the shortest possible URL at any cost. It is to establish one predictable URL for each indexable page and preserve that destination over time.

Operator rule: Treat URLs as persistent catalog identifiers. Change them only when the expected SEO or usability benefit justifies the migration work.

Magento URL structure best practices

A practical Magento SEO URL policy should define how the store handles product paths, category paths, suffixes, store codes, trailing slashes, and changed URL keys. Record these decisions before configuring individual products or creating redirects.

URL element Recommended default Main reason
Product category path Exclude it Keeps product URLs stable when merchandising categories change
Product and category suffix Omit on new stores Produces shorter URLs without tying pages to a file-like format
Store code Exclude unless the architecture requires it Avoids unnecessary path segments
Web server rewrites Enable Removes the index.php segment from public URLs
Base URL redirect Use 301 for a permanent preferred host Consolidates alternate host or base URL requests
Changed URL keys Create permanent redirects Preserves access to old paths

Apply the same rules to every store view unless language, market, or legal requirements call for a different structure. In multistore installations, check configuration scope before saving. A setting changed at the default level can affect more storefronts than intended.

Configure Magento 2 URL settings

Magento divides URL controls across its Web and Catalog configuration areas. Labels can vary slightly by Magento or Adobe Commerce version, but the following locations cover the core settings.

Configure the base URL

Go to Stores > Configuration > General > Web. Review the Base URLs and Base URLs (Secure) sections for the selected website or store view.

The secure base URL should use the intended HTTPS hostname. Avoid running indexable versions of the store on both HTTP and HTTPS or on both www and non-www hosts. Redirect all alternate versions to one preferred destination.

Under URL Options, keep Add Store Code to URLs set to No unless store codes are an intentional part of the international or multistore architecture. A store code can be appropriate when paths such as /de/ and /fr/ identify distinct regional storefronts, but it should not appear accidentally.

Set the base URL redirect

Magento's Auto-redirect to Base URL option determines how requests for an alternate base hostname are handled. For a permanent preferred host, select the 301 option rather than a temporary 302 response.

This setting is useful for base host normalization, but it is not a replacement for a complete redirect policy. Your web server, proxy, or content delivery network may also handle HTTP-to-HTTPS and www normalization. Test the full request path to make sure only one layer redirects each variation.

Review catalog SEO settings

Go to Stores > Configuration > Catalog > Catalog > Search Engine Optimization. This area contains settings for product category paths, URL suffixes, and automatic redirects after URL key changes.

According to Conductor's Magento SEO configuration guide, a clean default is to exclude category paths from product URLs, enable permanent redirects when URL keys change, and keep web server rewrites active.

Product URLs and category paths

Magento can generate a product URL with or without its category path. A product named “Trail Running Shoe” might therefore appear as either:

  • /trail-running-shoe
  • /men/shoes/trail-running-shoe

For most catalogs, set Use Categories Path for Product URLs to No. Product assignments often change due to seasonal merchandising, navigation redesigns, or catalog expansion. A category-independent product URL remains stable through those changes.

Excluding the category path also reduces the risk of creating several routes for one product when it belongs to multiple categories. This is particularly valuable in catalogs where products appear under brand, use case, audience, and seasonal collections at the same time. For a deeper look at how filter parameters compound this problem, see the guide to Magento faceted navigation and duplicate content.

Category paths can still be useful in smaller catalogs with a fixed hierarchy. If you retain them, define which path should represent each product and test how Magento handles products assigned to several categories. Do not assume the navigation path seen by a shopper is the only URL a crawler can discover.

Write stable URL keys

A Magento 2 SEO-friendly URL key should be concise, lowercase, and descriptive. Use hyphens between words and omit temporary information such as campaign names or category labels that may change.

Include product attributes only when they distinguish separate indexable products. For example, color may belong in the URL if each color has its own product page. It adds noise when color is simply a selectable option on one configurable product.

Do not change established URL keys solely to add another keyword. The possible gain from a slightly different slug is often smaller than the risk and operational cost of changing a URL that already has links, rankings, and history.

Suffixes and trailing slashes

Magento commonly uses .html as the product and category URL suffix. You can change the Product URL Suffix and Category URL Suffix fields in the Catalog Search Engine Optimization configuration.

For a new store, leaving these fields empty creates cleaner paths. The suffix does not provide a direct SEO advantage, and removing it makes future URL structures less dependent on a file-like convention.

For an established store, removing .html changes every affected URL. Do not clear the fields in production without first mapping each old URL to its new equivalent. A page such as /running-shoes.html should return a single 301 redirect to /running-shoes, not a 404 or a chain through another URL.

Choose one trailing-slash policy

Decide whether storefront paths end with a slash, then enforce that policy consistently at the web server, proxy, or application edge. The choice itself matters less than preventing both versions from returning a successful response.

Test products, categories, CMS pages, paginated pages, and static assets before applying a broad server rule. An overly general rule can break files, interfere with query strings, or create a redirect loop with Magento's own routing.

Enable web server rewrites

Under Stores > Configuration > General > Web > Search Engine Optimization, set Use Web Server Rewrites to Yes. This removes index.php from public storefront URLs and produces cleaner request paths.

The option depends on correct web server configuration. Apache installations need rewrite support and an appropriate Magento configuration file. Nginx installations need routing rules that pass storefront requests to Magento correctly.

After enabling the setting, test a representative product, category, and CMS page. Check both the final browser URL and the HTTP status sequence. If the clean path returns a 404, fix the server configuration rather than switching the Magento option repeatedly.

Test: Request an old or non-preferred URL with a status checker. The ideal permanent migration produces one 301 response followed by one 200 response at the final URL.

301 and 302 redirects

A 301 response tells browsers and search engines that a resource has moved permanently. A 302 response represents a temporary move. Use the status that reflects the actual business decision rather than treating all redirects as interchangeable.

flowchart TD
    A["URL changed or removed"] --> B{"Permanent\nchange?"}
    B -- "Yes" --> C{"Has a relevant\nreplacement?"}
    C -- "Yes" --> D["301 redirect to\nreplacement"]
    C -- "No" --> E["Return 404 or 410"]
    B -- "No" --> F["Use 302 temporary\nredirect"]
    D --> G{"Multiple hops\nin chain?"}
    G -- "Yes" --> H["Replace with direct\n301 to final URL"]
    G -- "No" --> I["Done"]
URL redirect decision flow: choose 301 for permanent moves, 302 for temporary, and always consolidate redirect chains.
Situation Recommended response
Product URL key permanently changed 301
Category permanently renamed or replaced 301
.html suffix permanently removed 301
Catalog moved from another platform 301
Short-lived campaign routing or temporary maintenance Temporary redirect, if a redirect is appropriate
Page permanently removed without a relevant replacement 404 or 410

A redirect should point to the closest relevant destination. Redirecting every discontinued product to the homepage creates a poor user experience and may be interpreted as a soft 404. Use a successor product or a closely matching category when one exists.

Reserve 302 redirects for genuinely temporary cases. Magento's base URL auto-redirect may default to temporary behavior in some configurations, so verify that the preferred host uses a 301 response when the hostname decision is permanent.

Manage Magento URL rewrites

Magento stores mappings between incoming request paths and target paths. You can review them under Marketing > SEO & Search > URL Rewrites.

To create a custom permanent redirect:

  1. Select Add URL Rewrite.
  2. Choose Custom as the rewrite type.
  3. Select the correct store view.
  4. Enter the old path in Request Path.
  5. Enter the destination in Target Path.
  6. Select 301 Permanent as the redirect type.
  7. Save the rewrite and test it from an uncached request.

Use relative storefront paths where the interface expects them. Confirm whether the path should include a leading slash in your installed version or extension before importing rewrite data at scale.

When a product URL key changes

Keep Create Permanent Redirect for URLs if URL Key Changed set to Yes. When an administrator changes a product or category URL key, Magento can then preserve the previous request path with a permanent redirect.

Automatic rewrites reduce missed redirects, but they do not remove the need for governance. Repeated URL changes can create chains such as old path to intermediate path to current path. Replace those chains with direct mappings from every known legacy URL to the current destination.

Before a bulk product update, identify whether the import changes URL keys. Preparing a focused CSV and validating changed fields also helps prevent unintended catalog effects. Poor product data quality also affects onsite search. For guidance on that topic, see Magento search optimization and onsite search. The guide to safer Magento bulk imports explains how to isolate and validate catalog changes before merging them into production.

Redirect strategy for catalog migrations

A catalog migration may change product keys, category hierarchies, suffixes, store codes, and domains at the same time. Redirect planning should therefore begin before the new Magento routes are finalized, not after launch traffic starts reaching 404 pages.

1. Export every known old URL

Combine URLs from the current platform, XML sitemaps, analytics landing pages, Google Search Console, backlink reports, and a full site crawl. Do not rely only on URLs found in the active catalog. Search engines may still request discontinued or previously redirected paths.

2. Create a mapping table

Use one row per old URL with fields for the old path, proposed destination, redirect status, destination type, store view, owner, and test result. Keep this table as the controlled source for implementation and review.

Map products to equivalent products wherever possible. Map removed products to close successors or relevant categories. Leave URLs without a meaningful replacement as 404 or 410 rather than sending unrelated traffic to the homepage.

3. Resolve conflicts before import

A request path must not compete with an active product, category, CMS page, or another custom rewrite. Normalize capitalization, suffixes, encoded characters, and trailing slashes before checking for duplicates.

4. Test on staging

Load the mapping into a production-like environment and crawl every old URL. Validate the first response, final status, destination, canonical host, protocol, and store view.

The workflow recommended by Qoliber's Magento URL guide follows the same operating pattern: audit existing URLs, plan legacy redirects, test on staging, and monitor indexation after release.

5. Monitor after launch

Submit updated sitemaps and monitor crawl errors, indexed pages, landing-page traffic, and redirect behavior. Keep the old redirect mappings active long enough to serve search engines, external links, bookmarks, and delayed catalog feeds.

Review server logs for frequently requested 404 paths that were missed during planning. Add redirects only when there is a relevant destination. A growing rewrite table should remain an intentional routing layer, not a collection of speculative rules.

Common Magento URL problems

Products have multiple category URLs

Disable category paths for product URLs if the catalog does not require them. Crawl the storefront to identify previously generated alternatives, then redirect duplicate historical paths to the selected product URL.

Both suffix versions return 200

Choose the preferred format and redirect the other version. Update navigation links, sitemaps, feeds, and templates so they point directly to the destination rather than relying on redirects.

The store uses 302 for a permanent host

Review Auto-redirect to Base URL and the web server or proxy configuration. Change the responsible layer to 301, then confirm that another layer is not adding a second redirect.

Changed URL keys produce chains

Export or crawl the existing redirects and trace every hop. Replace chained mappings with direct 301 redirects to the current product or category URL.

A rewrite causes a loop

Compare the request path and target path after hostname, suffix, and trailing-slash normalization. Disable the conflicting rule, clear relevant caches, and retest before restoring it.

Imported rewrites affect the wrong store

Check the store view assigned to each rewrite. The same request path can behave differently across storefronts, especially when store codes or localized URL keys are used.

Old URLs return 404 after launch

Compare server logs and crawl reports against the approved migration table. Add missing mappings in controlled batches, test them, and record the result in the same table.

Build a repeatable URL workflow

URL changes become risky when administrators edit them one by one without a shared policy. A better process separates analysis, implementation, validation, and release.

  1. Export current products, categories, URL keys, and rewrites.
  2. Flag proposed URL changes in a reviewable table.
  3. Generate old-to-new redirect mappings.
  4. Check for duplicate paths, loops, and missing destinations.
  5. Test the changes on staging.
  6. Import approved data and crawl the production result.
  7. Monitor 404 requests and search performance after release.

This approach is particularly useful for agencies managing large Magento catalogs. It creates an audit trail and allows teams to review exceptions instead of checking every unchanged row manually.

bulkbase.ai can help prepare and validate structured catalog fields from CSV data before they are imported into Magento. Teams can build chained prompts and validators while retaining control over prompts, outputs, and their own API costs. Review the structured workflow process to see how analyze, transform, validate, and merge steps fit together.

Get started for Free

Every trial starts with a free guided demo, what are you waiting for.

Learn more →

Test a catalog URL workflow

If you need to prepare URL keys, migration mappings, or validation fields across a large catalog, book a guided demo to review the workflow with your own data. Booking a demo is the required first step to start a free trial.

Frequently Asked Questions

What is the best Magento product URL structure?

For most stores, use a short product path without the category hierarchy. This keeps the product URL stable when category assignments change and reduces the chance of duplicate category-based paths.

Should Magento URLs include .html?

New stores can omit the .html suffix for cleaner URLs. Existing stores should remove it only as a planned migration, with a direct 301 redirect from every old suffixed URL to its new destination.

Should Magento use 301 or 302 redirects?

Use 301 for permanent changes such as renamed products, restructured categories, new domains, or removed suffixes. Use a temporary redirect only when the destination change is genuinely temporary.

How do I redirect a Magento URL?

Go to Marketing > SEO & Search > URL Rewrites, add a custom rewrite, enter the old request path and new target path, and select the 301 permanent redirect type. Test the result after saving.

Should Magento include category paths in product URLs?

Usually not. Category-independent product URLs remain stable through merchandising changes and avoid creating different paths for products assigned to several categories.

What happens when a Magento product URL key changes?

If permanent redirects for changed URL keys are enabled, Magento creates a rewrite from the previous path to the new path. Teams should still check for conflicts and chains after bulk changes.