Redirects with Custom CDN
Hi there,
I'm currently using AEM as a Cloud Service and have Akamai configured on top of it. Akamai is correctly routing traffic to my AEM publish instance at: "publish-pxxx-exxxx.adobeaemcloud.com" and everything seems to work fine at first glance. However, I'm encountering an issue with redirects defined in the Dispatcher configuration. When a redirect is triggered, the "Location" header returned includes the full origin domain instead of the CDN domain, which causes the user to be redirected away from the CDN.
For example, I have the following rule in my dispatcher:
RewriteRule ^/?$ /index [R=301,L]The flow is as follows:
A user accesses: www.mycdn.domain/
Akamai forwards the request to my publish instance: publish-pxxx-exxxx.adobeaemcloud.com/
The Dispatcher processes the request and issues a 301 redirect
The response includes a Location header pointing to publish-pxxx-exxxx.adobeaemcloud.com/index
Instead, I would expect it to redirect to www.mycdn.domain/index
This behavior causes the user to leave the CDN domain, which is not ideal.
Am I missing something here? Is this the expected behavior when using Apache redirects behind a CDN? Any explanation and suggestions for how to handle this properly would be greatly appreciated.
Thanks in advance!

