31/01/2024

Solving the multi-tenant vanity URL dilemma on Adobe AEM

Author: Roland Gruber

Adobe AEM has the capability to manage thousands of domains with a single instance. However, vanity URLs are not tenant-specific; they are only possible globally for all domains. We have developed an open-source solution specifically for this issue, allowing editors to seamlessly manage vanity URLs across multiple domains.

Vanity URLs are important for marketing campaigns to drive your visitors to the right content. While this works well for single sites on one AEM instance it is not that easy in a multi-domain context. The issue is that vanity URLs on AEM are defined globally.

What are the Key Characteristics of a Good Vanity URL?

Vanity URLs are used in online and offline marketing campaigns. They point your target audience to the right content on your website. Therefore, it is important that these URLs:

  • Are short and memorizable. Clients should be able to remember them after a few hours or even days.
  • Contain the right keywords. There must be a mental link between the campaign content and the URL.
  • Generate trust by being short and clear instead of being complex including lots of segments, parameters and IDs.

Of course, the final content might be located at a location much deeper in your URL structure. You can redirect to it from the vanity URL.

Here is a good vanity URL example for a campaign to find new talents: https://www.ibm.com/jobs

You can imagine that a reader will be able to enter this URL in the browser even days after an event.

The Issue

 Let’s assume you have three country websites on your AEM instance and all run campaigns to find new talents. To support the campaigns all requested to have a vanity URL “/jobs” like this:

  • https://ibmix.de/jobs
  • https://ibmix.at/jobs
  • https://ibmix.hr/jobs

Since vanity URLs are global in AEM they cannot be used for multiple pages. You would get a random page of de/at/hr when requesting one of the above “/jobs” URLs.

How to Solve the Dilemma of Global Vanity URLs in AEM?

AEM is built on the Sling framework. As vanity URLs in Sling do not contain any context they are defined on a global level. This means if you assign a vanity URL to a page in one domain it will also be valid when requests come in for other domains. Effectively, this does not allow to use the same vanity URL (e.g. “/jobs”) for multiple domains.

A simple solution to solve this issue is to add a domain-specific prefix to vanity URLs. Of course, you do not want to show this prefix in the URL for the end user. Therefore, you need to manage this in your webserver configuration and readd the right prefix for incoming requests depending on the domain.

We face two issues now:

  1. How to add the prefix only for vanity URLs and not for regular pages? If you do not use “.html” endings it is hard to know if an URL at top level is a vanity one or not. The solution is to set the prefix to the content path that is cut from the URL anyway. E.g. the prefix could be “/content/wknd/us/en/”.
  2. How to make sure that editors use the right prefix during content creation? Editors might not remember the prefix, copy content from other domains and forget to adjust the prefix, …

Also, the input field in AEM is plain text. It does not provide any support for these topics. This means we have a technical solution now but on the other side the editor experience is bad.

This is where our new OpenSource tool AEM Tenant Specific Vanity URLs comes to the rescue. It does all the prefix handling in the editor GUI. As an editor you will not even see the prefix or need to know about it. Our tool will automatically remove the prefix when an editor manages page properties. And on saving the properties the prefix will be readded. There is no need for editors to remember technical prefixes. They just enter e.g. “jobs”. Depending on the page tree the right prefix will be used. All transparent for your editors. This way we can solve the issue and keep our great editor experience.

As a bonus the tool can also show a list of effective vanity URLs in the system. This helps you to monitor which URLs are still active. You are then able to remove outdated vanity URLs and can check if a similar or identical vanity URL already exists.

 

Try it out now

Our Open Source tool AEM Tenant Specific Vanity URLs helps you to manage vanity URLs in a multi-tenant setup. You can use it for free and checkout our example configuration including a multi-domain dispatcher configuration with the same vanity URLs. The package is published on Maven Central and can be embedded in your deployment package.

If you face any issues or have suggestions for improvement, we appreciate your feedback on our issue tracker.

You can also watch Roland Gruber’s talk at the adaptTo() conference 2023 to see it in action.

Adobe Solution Partner – Experience Cloud

IBM iX is a leading Adobe Platinum Solution Partner and “EMEA Partner of the Year 2021”. We have been working with Adobe solutions for over 20 years and have implemented more than 450 projects for our customers – with more than 100 local, 200 near- and 500 offshore consultants.

Let's talk Get in touch

This might also interest you