Hope all are doing great! Actually, reaching out here to get some clarification on one AEM Out of the Box feature.
Would be great to hear back !
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Hey DJ Sarkar!
Using custom filter's for redirects may create some confusion down the line.
Why not modify the OOTB /libs/sling/servlet/errorhandler/404.jsp, in code call your service to verify if this path needs to be 301 or 404. Depending on the outcode either redirect page or serve a 404.
This way it will always get triggered and allow you to redirect any page where needed.
Regards,
Peter
Hey DJ Sarkar!
Using custom filter's for redirects may create some confusion down the line.
Why not modify the OOTB /libs/sling/servlet/errorhandler/404.jsp, in code call your service to verify if this path needs to be 301 or 404. Depending on the outcode either redirect page or serve a 404.
This way it will always get triggered and allow you to redirect any page where needed.
Regards,
Peter
Hello @DJSarkar ,
The solution described in the original post calls for maintaining a list/record of pages that could grow over time and the overhead of keeping that list in sync across AEM publish instances. In the event of failure of an existing AEM publisher instance or an additional new AEM publisher instance in the cluster, I can imagine a file in GIT repository to be deployed to that instance.
To maintain HTTP 301 and HTTP 302 page responses for known list of pages, there are the few out of the box/alternate features that could be leveraged,
1. Use the 302 redirect field from the page properties called "Redirect" (property name:"cq:redirectTarget").
2. (AEM On-premises only) Use the ACS Commons provided Map Manager to keep a list of redirects. One dedicated page for HTTP 301 and another for HTTP 302.
3. Leverage CDN to maintain the list of urls and their redirects.
4. Dispatcher Web server configurations.
These methods would also prevent calls to AEM Publishers which eventually would be a HTTP 301 or HTTP 302.
thanks,
Preetpal
@DJSarkar Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Hi Kautuk,
The suggestion provided by Peter was covering most of the use scenarios while some of them could not due to earlier buffer state being flushed. But that worked out for happy paths! hence marked that as correct approach. Thanks !
@DJSarkar I hope you found the AEM community helpful. We look forward to your return as either a learner or a mentor. The community flourishes with SMEs like you. Please encourage your AEM peers to contribute as well. Happy AEM learning!
Views
Likes
Replies
Views
Like
Replies