AEM URL shortening issues with extension removal and Sling mappings
URL shortening in AEM can fail when attempting to remove extensions, hide internal paths, or rewrite segments. To fix the issue, use supported rewrite mechanisms, validate mappings, and acknowledge platform constraints.
Description description
Environment
- Adobe Experience ManagerĀ as a Cloud Service (AEMaaCS)
- AEM Managed Services
- AEM On-Premise (6.5 and earlier)
Issue/Symptoms
- Short URLs do not resolve on Publish but work in local environments
.htmlextension is not removed on cloud deployments- URLs with # fragments are not mapped or rewritten
- Rewriter pipelines apply to unintended content paths
- Reserved paths such as
/experimentscannot be modified - Duplicate
model.jsonrequests occur in SPA implementations
Root cause
URL shortening issues occur due to unsupported features in cloud environments, HTTP limitations with URL fragments, misconfigured Sling mappings, overlapping rewriter configurations, and required system paths that cannot be altered.
How to confirm
- Compare behavior between local and Publish environments
- Inspect browser network requests to verify URL resolution
- Check for multiple model.json calls in SPA implementations
- Review logs for mapping or rewrite rule execution
Resolution resolution
To fix the issue:
- Use Dispatcher or CDN rewrite rules (such as Apache
mod_rewrite) to handle extension removal and URL shortening. - Avoid attempting to map or rewrite URL fragments (
#), as they are not processed server-side. - Ensure rewriter pipelines have unique order values and distinct path scopes.
- Do not modify system-reserved paths such as
/experiments, as they are required for specific product features. - Update Sling mappings to ensure short URLs correctly resolve to internal content paths, especially for SPA implementations.
- For on-premise setups, configure server-level rewrite rules to support extension removal.
Related reading
recommendation-more-help
experience-cloud-kcs-help-kbarticles