Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to rewrite DAM assets URL for cross-site linking?

Avatar

Level 8

I have 3 sites in my AEM instance.

- /content/staff (staff.myhost.com)

- /content/customer (customer.myhost.com)

- /content/others (others.myhost.com`)

I have a page in /content/staff (example: /content/staff/en/sample-page). In this page, I have created a link to /content/customer/en/my-page-here.

When I published my page, the link URL is displayed as customer.myhost.com/my-page-here and this is correct.

The problem is that if I create another link on /content/staff/en/sample-page to a PDF that resides in the DAM area (example: /content/dam/customer/my-pdf-here.pdf) for the customer site, no rewriting is showing.

The PDF link is shown as staff.myhost.com/content/dam/customer/my-pdf-here.pdf. It should be shown as customer.myhost.com/content/dam/customer/my-pdf-here.pdf.

Any ideas what I could be doing wrong?

I have the following mapping

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

          jcr:primaryType="sling:Mapping"

          sling:internalRedirect="[/content/customer/en(/.+)?,/content/dam/customer(/.+)?]"

          sling:match="customer.myhost.com$1"/>

1 Accepted Solution

Avatar

Correct answer by
Employee

Considering all other configs are in place. What I believe is domain rewriting might be overlooked here as you possibly have same structure for DAM in both customer.myhost.com and staff.myhost.com. If content paths are duplicated across multiple sites , it will use first best match.

While if you check for the content tree , its following hence rewriting works well with distinct content tree

- /content/staff (staff.myhost.com)

- /content/customer (customer.myhost.com)

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

Considering all other configs are in place. What I believe is domain rewriting might be overlooked here as you possibly have same structure for DAM in both customer.myhost.com and staff.myhost.com. If content paths are duplicated across multiple sites , it will use first best match.

While if you check for the content tree , its following hence rewriting works well with distinct content tree

- /content/staff (staff.myhost.com)

- /content/customer (customer.myhost.com)