Hi Everyone,
Currently, in my project, we handle URL shortening using dispatcher rules like below.
Example: www.domain.com/us/en/testpage.html -> internal redirect to /content/project/us/en/home/testpage
Now, we have a new requirement: we need to achieve this without using a dispatcher rules.
Example:
If I access www.domain.com/us/en/testpage.html or www.domain.com/testpage.html, it should resolve to the path /content/project/us/en/home/testpage
Experts, kindly suggest your solutions. Thanks in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @jooca
There is no centralized management Ui in AEM to manage vanity redirects in AEM.
You can check below article for vanity URL management redirects in AEM and dispatcher URL configurations
https://experienceleague.adobe.com/en/docs/experience-manager-learn/ams/dispatcher/disp-vanity-url
https://blog.3sharecorp.com/enabling-vanity-urls-with-adobe-experience-manager
Hope this helps !
Thanks
Hi @jooca
You can use sling mappings for the URL shortening in AEM with resource resolver.
Below is the recent blog shared by @daniel-strmecki for the same. Check it out
Hope this helps
Can you explain how vanity path URLs working for pages? I need to see the technical details, like GitHub code examples. I want to apply the same concept to DAM assets as well.
Hi @jooca
There is no centralized management Ui in AEM to manage vanity redirects in AEM.
You can check below article for vanity URL management redirects in AEM and dispatcher URL configurations
https://experienceleague.adobe.com/en/docs/experience-manager-learn/ams/dispatcher/disp-vanity-url
https://blog.3sharecorp.com/enabling-vanity-urls-with-adobe-experience-manager
Hope this helps !
Thanks
Can someone explain how vanity path URLs working for pages? I need to see the technical details, like GitHub code examples. I want to apply the same concept to DAM assets as well.
To implement URL shortening without dispatcher rules in AEM, you can use Sling Mappings. This allows you to map custom URLs to resources. For DAM assets, you can use vanity URLs.
For detailed steps on vanity URL management and using Sling Mappings, you can refer to these resources:
Vanity URL Configuration in AEM- https://experienceleague.adobe.com/en/docs/experience-manager-learn/ams/dispatcher/disp-vanity-url
Enabling Vanity URLs in AEM - https://blog.3sharecorp.com/enabling-vanity-urls-with-adobe-experience-manager
These guides will help you apply the same concept to DAM assets.
@jooca just be careful with using Sling mappings in case you need to support the same Vanity URLs on multiple domains. Reasons why are explained in the article: https://meticulous.digital/blog/f/aem-url-shortening-sling-mappings-vs-dispatcher-rewrites
Also, you said you have a requirement "We need to achieve this without using Dispatcher rules". How and why is that a requirement? Business requirements are usually "I want to have short URLs" or "I want to have SEO-optimized URLs" and then it's up to the development team to find the best implementation.
Good luck,
Daniel