Best practices to rewrite urls with AEM | Community
Skip to main content
Gaurav-Behl
Level 10
April 7, 2022

Best practices to rewrite urls with AEM

  • April 7, 2022
  • 1 reply
  • 2546 views

Background: In one of the implementations, we have a reverse proxy in front of AEM setup & following microservices based architecture and a hybrid content delivery model.

The requirements are to manipulate both inbound & outbound urls for architectural (& SEO) reasons. Broadly, it can be categorized into two buckets:

  1. Manipulate the urls within AEM
  2. Manipulate the urls outside AEM meaning mounting a specific pattern on AEM root to simplify routing between AEM & non-AEM apps

I've seen various implementations within & outside AEM using resolver, etc-map, Transformers, ACS-Commons, bespoke solutions, apache, nginx etc. but there are pros/cons to each depending on the end-goal. 

 

I'd love to hear from the SMEs about the best practices or maybe pitfalls to avoid in general (or AEMaaCS specifically) that could potentially become a bottleneck down the line.

 

Thanks in advance!

 

CC: @joerghoh @tadreeves 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Peter_Puzanovs
Community Advisor
Community Advisor
April 8, 2022

Hi Gaurav,

 

Great discussion.

 

There's no one rule fit's all here. It all depends on the use case and tech stack you have.

 

Preparing right url's upfront in AEM is a great beginning, to avoid any redirects in first place.

 

Routing to correct url's via Apache is a solid way to go on from here.

 

Where Apache lack's functionality or get's too complex, CDN / Varnish / NGinX will help.

 

Once these are in place, redirects will be needed as project life goes on, they can be offloaded to the most appropriate layer.

 

Generally for few redirects with minimal traffic Publishers are good, once we start hitting thresholds might be good idea to move to CDN or Apache.

 

Regards,

Peter