Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

How to remove /categories/ and /products/ prefixes from AEM Storefront URLs for SEO-friendly structure?

Avatar

Level 4

Hi everyone,

 

I’m working with Adobe Experience Manager Storefront Delivery Services and need to customize my URL structure for categories and products to be cleaner and more SEO-friendly. Right now, my URLs look like this:

 

Categories:
https://example.com/categories/maquillaje

 

Products:
https://example.com/products/toleriane-purifying-foaming-face-wash-for-oily-skin/ULT0011

 

The client’s requirement is to remove those prefixes so the URLs become:

 

Categories:

https://example.com/maquillaje

 

Products:
https://example.com/toleriane-purifying-foaming-face-wash-for-oily-skin/ULT0011

 

What I’ve tried:

 

  • Edited fstab.yaml to add redirects from /categories/* and /products/* to the root, but accessing the new paths returns 404.
  • Reviewed the StorefrontRouter and rewrite rules in the archetype, but I’m unsure which configuration files take precedence in Edge Delivery.
  • Checked Adobe docs on URL rewrites, but didn’t find a clear example for removing both prefixes.

 

SEO considerations:

 

  • URLs must be prefix-free for shorter, keyword-focused paths.
  • Canonical tags need updating to point to the new URLs.
  • Implement 301 redirects from old URLs to the new structure to preserve link equity.

 

Questions:

 

  1. Which AEM Storefront configuration (fstab, Fastly VCL, or StorefrontRouter) controls the removal of /categories/ and /products/ prefixes?
  2. What is the correct syntax or example in fstab.yaml or VCL to rewrite those paths at the root level?
  3. How should I update canonical tags in AEM Headless or within the Storefront templates once the prefixes are removed?
  4. Any best practices for handling 301 redirects in the Edge Delivery Service to ensure SEO continuity?

 

Thank you in advance for your guidance!

1 Reply

Avatar

Community Advisor

Hi @olsalas711 ,

You can try to customize the URL with following options:

Custom URL Formats

To provide a custom URL format, a project can implement either the ProductUrlFormat or the CategoryUrlFormat service interface and register the implementation as OSGI service. Those implementations, if available, replace the configured, pre-defined format. If there are multiple implementations registered, the one with the higher service ranking replaces the ones with the lower service ranking.

The custom URL format implementations must implement a pair of methods to build a URL from given parameters, and to parse a URL to return the same parameters respectively.

Combine with Sling Mappings

In addition to the UrlProvider, it is also possible to configure Sling Mappings to rewrite and process URLs. The AEM Archetype project also provides an example configuration to configure some Sling Mappings for port 4503 (publish) and 80 (Dispatcher).

Combine with AEM Dispatcher

URL rewrites can also be achieved by using AEM Dispatcher HTTP server with mod_rewrite module. The AEM Project Archetype provides a reference AEM Dispatcher config which already includes basic rewrite rules for the generated size.

 

 

You can find more details on below link:
https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/content-and-comm...

 

 

-Tarun