DAM Path Shortening | Community
Skip to main content
Level 5
December 13, 2022

DAM Path Shortening

  • December 13, 2022
  • 2 replies
  • 1760 views

Hi,

 

We need to shorten some DAM PDF url in our website.

 

E.g. 

 

if PDF Path is:

/content/dam/cms/myproject/resources/documents/mydoc.pdf,

 

on page, whether is a href or img src, It should display like /Documents/mydoc.pdf

 

Added rule as below in Sling Resource Resolver Factory:

 

^/content/dam/cms/myproject/resources/documents/</Documents/

 

When I try to check if it maps to right url, it looks all good.

 

 

However, It does not shorten PDF urls on the Pages, whereas all rewrite rules for Pages work fine.

 

1) Do we need to write custom sling rewriter to handle this scenario?

OR

2) Something is missing out here?

 

 

 

FYI:@arunpatidar  @ AvinashGupta01 @kautuk_sahni ,

 

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

2 replies

SantoshSai
Community Advisor
Community Advisor
December 13, 2022

Hi @arvind-1 ,

Please refer this one: https://www.linkedin.com/pulse/url-management-aem-stack-tushar-garg/

Hope that helps!

Regards,

Santosh

Santosh Sai
arvind-1Author
Level 5
December 14, 2022

@santoshsai  Thanks a lot for your time.

 

I went through above shared link and I found only this part for DAM assets. 

Does it mean that we need to write something custom to shorten dam urls in our website? like Rewriter , transformer factory etc?

 

 

 

aanchal-sikka
Community Advisor
Community Advisor
December 14, 2022

hello @arvind-1 

 

As suggest on the link shared by @santoshsai .

The URL shortening can also be achieved by using "dispatcher" + "Sling Mappings"

 

Dispatcher can take care of the URL rewites:

  • Shortening URLs, if user enters full URL
  • Converting short to long URLs based on vhost configs 

 

The Sling mappings would take care of URL shortening in the content section.

 

Explanation also available on: https://helpx.adobe.com/ro/experience-manager/kb/multi-domain-management-aem-mappings-for-url-shortening---aem-6-.html

https://www.youtube.com/watch?v=bJ_cXcAE7G8 It shows step-by-step how each config enhances the overall solution

Aanchal Sikka
Level 4
January 5, 2024

Hi @arvind-1 ,

I see it has been a while since there is any activity on this post but did you manage to find any solution to dam URL re-write other than using the custom link transformers ?

 

Regards,

Balaram