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

Avatar

Avatar

jayv25585659

Avatar

jayv25585659

jayv25585659

07-03-2019

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"/>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Nisha_Nivedita

Employee

Avatar

Nisha_Nivedita

Employee

Nisha_Nivedita
Employee

07-03-2019

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)

Answers (0)